JSPM

@hazae41/bitset

1.0.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 21
  • Score
    100M100P100Q67487F
  • License MIT

Utilities for arithmetic bitwise operations in JavaScript

Package Exports

  • @hazae41/bitset

Readme

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"