I tried https://github.com/tdegrunt/bitset, it’s a nice CoffeeScript implementation, but there’re a few things I don’t get, for one, its position starts from 1, not 0. If that could be overcomed, there’s the poor #cardinality implementation, which really iterates every bit to sum it up. The last straw was the fact that #nextSetBit was completely missing.
https://github.com/bramstein/bit-array has a much better cardinality implementation, but it doesn’t provide #nextSetBit either, and the real headache was that “and”, “or”, “xor” operations all require the inner words array to have identical length.
That does it, I’ll have to get a BitSet works better than that, if not better than java.util.BitSet
Not much to brag about, just an attempt to ease my node.js development, that could perform a faster cardinality & could give a nextSetBit api. Yet fully tested though.