#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

#1876 in Data structures

Download history 48/week @ 2023-12-11 58/week @ 2023-12-18 40/week @ 2023-12-25 17/week @ 2024-01-01 88/week @ 2024-01-08 61/week @ 2024-01-15 11/week @ 2024-01-22 21/week @ 2024-01-29 38/week @ 2024-02-05 54/week @ 2024-02-12 48/week @ 2024-02-19 77/week @ 2024-02-26 48/week @ 2024-03-04 54/week @ 2024-03-11 70/week @ 2024-03-18 120/week @ 2024-03-25

306 downloads per month
Used in 21 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