bit_set 0.1.0 copy "bit_set: ^0.1.0" to clipboard
bit_set: ^0.1.0 copied to clipboard

Dart 1 only

Efficient implementation of a bitset.

bit_set #

An implementation of a bit set, which is missing from the Dart core library. It has the following features:

  • Efficient storage (uses Uint32List).
  • Efficient bit mask operations (and, or, xor, not).
  • Efficient counting of set bits.
  • Efficient lookup for the next set bit.
  • Support for change notifications and versioning.

###Usage

var bitset = new BitSet.fromString("01010");
var length = bitset.length;  // 5
bitset.insertAt(1, 2, true);  // 0111010
var bit = bitset[2];  // true
var count = bitset.countBits(true);  // 4
var xor = bitset.clone().xor(bitset);
count = bitset.countBits(true);  // 0

###TODO:

  • Use Uint32x4List for storage and make use of SIMD instructions.
  • Serialization.
  • Compression.
0
likes
15
pub points
0%
popularity

Publisher

unverified uploader

Efficient implementation of a bitset.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

More

Packages that depend on bit_set