# Hex and bit expressions in Bro scripts ?

**URL:** <https://community.zeek.org/t/hex-and-bit-expressions-in-bro-scripts/3407>\
**Category:** Zeek\
**Created:** [December 30, 2014, 9:09pm UTC](https://community.zeek.org/t/hex-and-bit-expressions-in-bro-scripts/3407 "2014-12-30T21:09:13Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![John\_Donnelly](https://avatars.discourse-cdn.com/v4/letter/j/3ec8ea/32.png) [@John\_Donnelly](https://community.zeek.org/u/John_Donnelly)\
**Post date:** [December 30, 2014, 9:09pm UTC](https://community.zeek.org/t/hex-and-bit-expressions-in-bro-scripts/3407/1 "2014-12-30T21:09:13Z")

</div>

Hi,

Can bro scripts not handle binary and bit expressions ?

local temp = 32;

If ( temp & 0x20) {

}

I didn’t see a list of expressions in the online guide.

Also , I tried to add binary variables in the Ascii (tab separated files) it reads and it complained too:

#field count  
1 0x20

Pointers welcomed.

---

<div class="post-metadata">

**Author:** ![anthony\_kasza1](https://avatars.discourse-cdn.com/v4/letter/a/dfb087/32.png) [@anthony\_kasza1](https://community.zeek.org/u/anthony_kasza1)\
**Post date:** [December 30, 2014, 10:07pm UTC](https://community.zeek.org/t/hex-and-bit-expressions-in-bro-scripts/3407/2 "2014-12-30T22:07:31Z")

</div>

Nope. Neither are supported in the bro language. You could write a wrapper function and compile it into the core or a core plugin.

-AK

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/zeek/original/1X/f09d732bc2cc7c7cc7e35db67cf4e1d5233ce7a7.png) [@system](https://community.zeek.org/u/system)\
**Post date:** [May 6, 2022, 3:42pm UTC](https://community.zeek.org/t/hex-and-bit-expressions-in-bro-scripts/3407/3 "2022-05-06T15:42:19Z")

</div>


