# bit manipulation in bro scripts.

**URL:** <https://community.zeek.org/t/bit-manipulation-in-bro-scripts/229>\
**Category:** Zeek\
**Created:** [April 2, 2002, 6:51am UTC](https://community.zeek.org/t/bit-manipulation-in-bro-scripts/229 "2002-04-02T06:51:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vern](https://yyz1.discourse-cdn.com/flex011/user_avatar/community.zeek.org/vern/32/630_2.png) [@Vern](https://community.zeek.org/u/Vern)\
**Post date:** [April 2, 2002, 6:51am UTC](https://community.zeek.org/t/bit-manipulation-in-bro-scripts/229/1 "2002-04-02T06:51:53Z")

</div>

> does bro scripts support bit manipulation ?  
> for eg: to see if the nth bit is set/not ?

Only via mask\_addr(), which just lops off least significant bits.

Adding some built-in functions to do this would be quite easy, though.  
Just use mask\_addr() as a template for how to do it.

&nbsp;&nbsp;&nbsp;&nbsp;Vern

---

<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:36pm UTC](https://community.zeek.org/t/bit-manipulation-in-bro-scripts/229/2 "2022-05-06T15:36:27Z")

</div>


