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

bit-set

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bit-set

Module: bit-set Main Class: BitSet Description: BitSet is a class allowing user to create structure like java.util.BitSet Highlight: The major difference of this BitSet is an efficient implementation of #nextSetBit and #prevSetBit;

  • 1.0.1
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
3
Maintainers
1
Weekly downloads
 
Created
Source

Module: bit-set Main Class: BitSet Description: BitSet is a class allowing user to create structure like java.util.BitSet Highlight: The major difference of this BitSet is an efficient implementation of #nextSetBit and #prevSetBit;

User Guide: To use a BitSet, simply require('bit-set') as BitSet; And use new BitSet(); to create instances you need; Once you have a BitSet instance, it allows you to #set, #clear, #and, #or, #xor to modify the state of it. And #get, #nextSetBit, #prevSetBit, #cardinality methods are available to query the state of a BitSet. This implementation in particular provides #nextSetBit & #prevSetBit for the purpose of iterations, also its cardinality implementation is optimized to count the set bits more efficient, esp. when there're few bits set.

Limitations: BitSet words are in memory integers, we don't have int64 in javascript, which would speed up the operations further. (32 bits number would have to be converted to integer internally for the bit operations, that could be slower than int64) Buffer might be a much better choice, but would restrict the usage of BitSet to node.js (browser doesn't have Buffer support)

FAQs

Package last updated on 08 Jul 2013

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