Giter Site home page Giter Site logo

endless-bitset's Introduction

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.

endless-bitset's People

Contributors

luanpotter avatar

Watchers

James Cloos avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.