# Covert BitArray to Int64

**URL:** <https://discourse.julialang.org/t/covert-bitarray-to-int64/9193>\
**Category:** General Usage\
**Created:** [February 20, 2018, 5:38am UTC](https://discourse.julialang.org/t/covert-bitarray-to-int64/9193 "2018-02-20T05:38:20Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![stevengj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/stevengj/32/71_2.png) [@stevengj](https://discourse.julialang.org/u/stevengj)\
**Post date:** [February 20, 2018, 1:08pm UTC](https://discourse.julialang.org/t/covert-bitarray-to-int64/9193/3 "2018-02-20T13:08:24Z")

</div>

If `b` is a 64-element `BitArray`, then `b.chunks[1]` is the same data as an `Int64`, but in bit-reversed order. There are various algorithms for efficiently bit-reversing back to regular order; I’m not sure which one is the fastest, but you can definitely do better than going bit-by-bit.

(But if this conversion is really performance-critical for you then a `BitArray` may not be the best choice of data structure.)

---

_[View the full topic](https://discourse.julialang.org/t/covert-bitarray-to-int64/9193)._
