#bitset #dense #bitmap

bitsets

BitSet implementations: Dense, Compressed, Memory-Mapped, and Roaring

2 releases

Uses old Rust 2015

0.1.1 Oct 20, 2018
0.1.0 Jun 10, 2018

#2042 in Data structures

Download history 103/week @ 2024-03-24 147/week @ 2024-03-31 47/week @ 2024-04-07 60/week @ 2024-04-14 70/week @ 2024-04-21 61/week @ 2024-04-28 62/week @ 2024-05-05 65/week @ 2024-05-12 69/week @ 2024-05-19 58/week @ 2024-05-26 52/week @ 2024-06-02 38/week @ 2024-06-09 77/week @ 2024-06-16 49/week @ 2024-06-23 13/week @ 2024-06-30 133/week @ 2024-07-07

274 downloads per month
Used in 23 crates (via cpclib-common)

MIT license

13KB
204 lines

bitsets

Various heap-allocated bitset implementations in Rust.

At the moment we provide a DenseBitSet datastructure, and plan to provide compressed and memory-mapped bitsets in the near future.

Usage

use bitsets::DenseBitSet;

let A = DenseBitSet::from_bits(0b1001100000100010);
let B = DenseBitSet::from_bits(0b1001100000100010);
let C = A.or(&B);

lib.rs:

A dense bit set implemented over std::Vec

Examples

use bitsets::DenseBitSet

let mut bs = DenseBitSet::with_capacity(1024);

bs.set(5);
bs.set(6);
bs.set(15);

if (bs.test(5) && !bs.test(13)) {
  println!("Hey it works!");
}

No runtime deps