npm.io
0.7.0-unstable.82 • Published 2 years ago

@transmute/compressable-bitstring

Licence
Apache-2.0
Version
0.7.0-unstable.82
Deps
2
Size
236 kB
Vulns
0
Weekly
0
Stars
55

@transmute/compressable-bitstring

npm i @transmute/compressable-bitstring@latest --save

Usage

import { Bitstring } from '@transmute/compressable-bitstring';
const bitstring = new Bitstring({ length: 8 });
bitstring.set(4, true);
expect(bitstring.get(3)).toBe(false);
expect(bitstring.get(4)).toBe(true);
expect(await bitstring.encodeBits()).toBe('H4sIAAAAAAAAAxMAAOn_tc8BAAAA');

About

This module is based on / interoperable with digitalbazaar/bitstring.