![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
@digitalcredentials/bitstring
Advanced tools
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
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});
Sets the value of a bit for the given position to the given boolean.
bitstring.set(1, true);
Gets the value of a bit for the given position.
bitstring.get(3);
Compresses and encodes bits to a base64url encoded string.
await bitstring.encodeBits();
Decodes and uncompresses a given base64url encoded string to a Uint8Array.
await Bitstring.decodeBits({encoded});
Compresses bits to a Uint8Array.
await bitstring.compressBits();
Uncompresses compressed bits.
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
3.1.1-3.1.2 - 2023-12-01
FAQs
Bitstring module for universal JavaScript
The npm package @digitalcredentials/bitstring receives a total of 0 weekly downloads. As such, @digitalcredentials/bitstring popularity was classified as not popular.
We found that @digitalcredentials/bitstring demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 9 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.