An open API service indexing awesome lists of open source software.

https://github.com/hazae41/bitset

Utilities for arithmetic bitwise operations in JavaScript
https://github.com/hazae41/bitset

arithmetic bitmask bits bitset bitwise browser javascript node typescript

Last synced: 6 months ago
JSON representation

Utilities for arithmetic bitwise operations in JavaScript

Awesome Lists containing this project

README

          

# Bitset

DEPRECATED

Utilities for arithmetic bitwise operations in JavaScript

```bash
npm i @hazae41/bitset
```

[**Node Package 📦**](https://www.npmjs.com/package/@hazae41/bitset)

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

### Usage

```typescript
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"
```