bitvek

Crates.iobitvek
lib.rsbitvek
version0.2.3
sourcesrc
created_at2024-07-02 23:29:16.856039
updated_at2024-10-26 15:56:39.758911
descriptionA simple bit vector implementation.
homepage
repositoryhttps://github.com/Lingxuan-Ye/bitvek
max_upload_size
id1290018
size26,467
Lingxuan Ye (Lingxuan-Ye)

documentation

README

bitvek

Crates.io Documentation License: MIT

Say, we have a bit vector —

it's nothing better than a Vec<bool>, but …

what if we implement it,

and save some poor bits of memory?

Quick Start

The following vector only takes two bytes of the heap memory!

use bitvek::bitvec;

let vec = bitvec![
    true, true, true, true, false, false, false, false,
    false, false, false, false, true, true, true, true,
];

Find it cumbersome? Try this:

// requires the total number of bits to be a multiple of 8
let vec = bitvec![0b1111_0000, 0b0000_1111];
Commit count: 42

cargo fmt