@thi.ng/bitfield

This project is part of the
@thi.ng/umbrella monorepo.
About
Typed array backed 1D / 2D bit field / bit matrix implementations. Due
to Uint32Array
backing, width is always a multiple of 32.
Installation
yarn add @thi.ng/bitfield
Dependencies
Usage examples
import { BitField, BitMatrix } from "@thi.ng/bitfield";
const field = new BitField(16);
field.setAt(0);
field.setAt(31, true);
field.at(0)
field.at(1)
field.toString();
field.resize(64)
const mat = new BitMatrix(8, 32);
for(let i = 0; i < 8; i++) mat.setAt(i, i);
mat.at(7, 7);
mat.toString();
Authors
License
© 2019 Karsten Schmidt // Apache Software License 2.0