Bitstring module for universal JavaScript
npm install @digitalcredentials/bitstring

> A Bitstring module for Javascript (Node, browsers, React Native).
To install get the latest version from NPM:
```
npm install @digitalcredentials/bitstring
To install locally for development:
``
git clone https://github.com/digitalcredentials/bitstring.git
cd bitstring
npm install
`js
import {Bitstring} from '@digitalcredentials/bitstring';
// You can make a new instance by passing in a length
const bitstring = new Bitstring({length: 10});
// OR by passing in a buffer
const buffer = Uint8Array.from([255]);
const bitstring = new Bitstring({buffer});
`
js
bitstring.set(1, true);
`$3
Gets the value of a bit for the given position.
`js
bitstring.get(3);
`$3
Compresses and encodes bits to a base64url encoded string.`js
await bitstring.encodeBits();
`$3
Decodes and uncompresses a given base64url encoded string to a Uint8Array.
`js
await Bitstring.decodeBits({encoded});
`$3
Compresses bits to a Uint8Array.
`js
await bitstring.compressBits();
`$3
Uncompresses compressed bits.
`js
await Bitstring.uncompressBits({compressed});
``Please follow the existing code style.
PRs accepted.
If editing the Readme, please conform to the
standard-readme specification.
BSD-3-Clause © Digital Bazaar