bva
is a rust crate for manipulating bit vectors and doing arithmetics on arbitrarily sized bit
vectors.
This crate emphasizes optimizing storage by providing alternative storage options.
The module fixed
contains implementations using unsigned integers as storage and thus
has a fixed capacity. The module dynamic
contains an implementation using dynamically
allocated array of integers as storage and therefore has a dynamic capacity. The module
auto
contains an implementation capable of switching at runtime between a fixed or
dynamic capacity implementation to try to minimize dynamic memory allocations.
All of those implementations implement the BitVector
trait and can be freely mixed together
and converted into each other.
None of the existing crate really satisfied me and I wanted an implementation capable of minimizing dynamic memory allocations by automatically switching to fixed storage. I also wanted a crate that was capable of doing arithmetics on arbitrarily sized bit vectors, not just powers of two. Also it was great practice for my rust macro writing skills.