Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

endless-bitset

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

endless-bitset

Endless and fast BitSet implementation

  • 1.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

endless-bitset

Build Status

An endless and fast bitset with some nice methods.

This is a wrapper around mattkrick's fast-bitset that allows for unlimited sizes.

It uses big-integer to access the higher indexes (but should work with plain old JS numbers for smaller indexes).

Installation

With yarn:

yarn add endless-bitset

Or with npm:

npm install endless-bitset --save

Features and Limitations

It's supposed to re-implement all methods from fast-bitset (they are a good selection), but I did just the ones I needed so far.
Technically, I guess it's limited by your RAM, your spare processing time and your call stack. But should be sufficient for most purposes.

API

Currently implemented are these methods from the original API:

  • BitSet
    • new BitSet(nBitsOrKey) : only for integer or bitInt parameters
    • .get(idx) ⇒ boolean
    • .set(idx) ⇒ boolean
    • .unset(idx) ⇒ boolean
    • .setRange(from, to) ⇒ boolean
    • .nextUnsetBit(idx) ⇒ number

I also added this property:

  • BitSet
    • length ⇒ integer : returns the max length, exactly as specified in the constructor

For the complete documentation, visit fast-bitset's readme.

FAQs

Package last updated on 14 Aug 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc