GitXplorerGitXplorer
i

bitset

public
0 stars
2 forks
4 issues

Commits

List of commits on branch master.
Unverified
890c2c0f8c85286b92d06668b52dd23008ad7d73

https://github.com/inexplicable/bitset/issues/1

committed 12 years ago
Unverified
8c57e4ac759183616aeac96a3901a87325d1a8e0

+ readme

committed 12 years ago
Unverified
0ad8bc8317bbca648fd415687ae9ffb3aa124129

+ 1.0.0 version

committed 12 years ago
Unverified
1af50e0b84264178b2e6b5b19355186101897ecf

+ 'use strict';

iinexplicable committed 12 years ago
Unverified
b0e01872dd715365aef053ade263f20b0ace9900

refactorings

iinexplicable committed 12 years ago
Unverified
2963ca2fc33d520a95e2ab857512b5a85662af11

+ #prevSetBit

iinexplicable committed 12 years ago

README

The README file for this repository.

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)