Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. JavaScript
  3. BitSet.js

BitSet.js

MITJavaScript

An infinite bit-array implementation in JavaScript with high performance and unique features like remembering leading ones on inversion.

Visit WebsiteGitHubGitHub
238 stars31 forks0 contributors

What is BitSet.js?

BitSet.js is a JavaScript library that implements an infinite bit-array (bit vector) data structure. It allows developers to perform efficient bitwise operations on arbitrarily large bit sequences, with unique features like remembering leading ones when inverted. It solves the problem of handling bit-level data in JavaScript with high performance and flexibility.

Target Audience

JavaScript developers working with binary data, bitwise operations, permissions systems, or low-level data structures that require efficient bit manipulation.

Value Proposition

Developers choose BitSet.js because it is the only JavaScript library offering infinite bit-array capabilities with leading-one retention, is heavily benchmarked for top performance, and provides a comprehensive set of bitwise operations in a minimal, compressible package.

Overview

The RAW arbitrary size Bit-Vector implementation in JavaScript

Use Cases

Best For

  • Implementing user permission systems with bit flags
  • Performing complex bitwise operations on large binary datasets
  • Creating and manipulating binary masks for graphics or networking
  • Storing and querying dense boolean arrays efficiently
  • Educational projects teaching bit-array data structures in JavaScript
  • Low-level data processing where bit-level control is required

Not Ideal For

  • Projects that only need simple boolean arrays or Set objects for small, sparse data without bit-level operations
  • Teams prioritizing high-level abstractions and convenience features over minimal, performance-focused code
  • Applications requiring extensive documentation, tutorials, or built-in integration with modern frameworks like React or Vue

Pros & Cons

Pros

Infinite Bit-Array

Uniquely remembers leading ones after inversion, enabling true infinite bit vectors as stated in the README, which no other JavaScript library offers.

High Performance

Heavily benchmarked and optimized to be the most performant bit-array implementation, with a focus on speed and efficiency for bitwise operations.

Comprehensive Operations

Includes a full suite of bitwise functions like AND, OR, XOR, NOT, flip, set, clear, and range operations, detailed in the functions section of the README.

Flexible Initialization

Accepts multiple input types including strings, arrays, numbers, Uint8Array, and other BitSet objects, making data loading versatile and easy.

Cons

Iterator Handling Pitfalls

When a bitset is inverted with leading ones, the iterator must be manually stopped by the user, which can lead to infinite loops if not carefully managed, as noted in the README.

Minimal Documentation

The README is concise and primarily an API reference, lacking in-depth tutorials, real-world examples, or guidance for complex use cases beyond basic snippets.

No Framework Integration

Designed as a standalone library without built-in support for popular frameworks or ecosystems, requiring additional setup and customization for modern web development stacks.

Frequently Asked Questions

Quick Stats

Stars238
Forks31
Contributors0
Open Issues4
Last commit1 year ago
CreatedSince 2014

Tags

#binary-manipulation#data-structures#bit-array#javascript-library#bit-manipulation#bitset#bitwise-operations#iterator#javascript#performance

Built With

J
JavaScript

Links & Resources

Website

Included in

JavaScript34.9k
Auto-fetched 18 hours ago

Related Projects

A curated list of awesome lists - @sindresorhusA curated list of awesome lists - @sindresorhus

😎 Awesome lists about all kinds of interesting topics

Stars488,229
Forks36,016
Last commit24 days ago
javascript-algorithmsjavascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings

Stars196,317
Forks31,049
Last commit27 days ago
You Don't Know JSYou Don't Know JS

A book series (2 published editions) on the JS language.

Stars184,616
Forks33,466
Last commit5 months ago
Clean Code JavaScriptClean Code JavaScript

Clean Code concepts adapted for JavaScript

Stars94,733
Forks12,513
Last commit2 years ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub