@hazae41/bitset
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Bitset

Utilities for arithmetic bitwise operations in JavaScript

npm i @hazae41/bitset

Node Package 📦

Current features

  • 100% TypeScript and ESM
  • Unit-tested
  • Big-endian and little-endian
  • Export to uint32
  • Builder pattern

Usage

const bitset = new Bitset(0x00, 8)

const result = bitset
  .toggleLE(1) // 0000 0010
  .toggleBE(1) // 0100 0010
  .unsign() // >>> 0
  .value

const last6 = bitset
  .last(6) // 00 0010
  .toString() // "000010"

Package Sidebar

Install

npm i @hazae41/bitset

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

23.8 kB

Total Files

12

Last publish

Collaborators

  • hazae41