# Parse an array of bits (\`BitArray\`) to an integer

**URL:** <https://discourse.julialang.org/t/parse-an-array-of-bits-bitarray-to-an-integer/42361>\
**Category:** New to Julia\
**Tags:** question\
**Created:** [July 1, 2020, 11:41am UTC](https://discourse.julialang.org/t/parse-an-array-of-bits-bitarray-to-an-integer/42361 "2020-07-01T11:41:45Z")\
**Posts on this page:** 1\
**Showing post:** 28

<div class="post-metadata">

**Author:** ![ellocco](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ellocco/32/31331_2.png) [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Post date:** [May 11, 2023, 11:52am UTC](https://discourse.julialang.org/t/parse-an-array-of-bits-bitarray-to-an-integer/42361/28 "2023-05-11T11:52:44Z")

</div>

Another option is:

```julia
bool2int(_boolarr) = evalpoly(2, reverse(_boolarr))

```

[see: vector-bool-to-int](https://discourse.julialang.org/t/vector-bool-to-int/89560/12)

---

_[View the full topic](https://discourse.julialang.org/t/parse-an-array-of-bits-bitarray-to-an-integer/42361)._
