{"_id":"fast-bitfield","_rev":"480954","name":"fast-bitfield","description":"Variable sized bitfield that allows you to quickly iterate over bits","dist-tags":{"latest":"1.2.2"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-05T09:36:49.000Z","created":"2018-08-16T17:00:53.532Z","1.2.2":"2018-12-11T10:25:36.096Z","1.2.1":"2018-08-21T19:19:27.280Z","1.2.0":"2018-08-20T23:31:17.337Z","1.1.2":"2018-08-20T23:09:21.756Z","1.1.1":"2018-08-20T22:08:38.092Z","1.1.0":"2018-08-20T18:30:40.428Z","1.0.1":"2018-08-17T16:37:13.339Z","1.0.0":"2018-08-16T17:00:53.532Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"versions":{"1.2.2":{"name":"fast-bitfield","version":"1.2.2","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{"count-trailing-zeros":"^1.0.1"},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"d5cbfd2e95eafd8707e2c1342fc91d939f1e287b","_id":"fast-bitfield@1.2.2","_npmVersion":"6.4.1","_nodeVersion":"10.13.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"7f08cdb46a6384b887a64127b56aa4d59bc8fa25","size":5202,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.2.2.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.2.2_1544523935976_0.2706636371392428"},"_hasShrinkwrap":false,"publish_time":1544523936096,"_cnpm_publish_time":1544523936096},"1.2.1":{"name":"fast-bitfield","version":"1.2.1","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{"count-trailing-zeros":"^1.0.1"},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"910b08ec299aa073c80c581fe7a5447f3e726802","_id":"fast-bitfield@1.2.1","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"49af46673e258969e6b7ca196dc2613a4b9a92c7","size":5127,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.2.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.2.1_1534879167150_0.3512139262671601"},"_hasShrinkwrap":false,"publish_time":1534879167280,"_cnpm_publish_time":1534879167280},"1.2.0":{"name":"fast-bitfield","version":"1.2.0","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{"count-trailing-zeros":"^1.0.1"},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"376a9b49404427b21b1c76c759ac76af3dcac4e0","_id":"fast-bitfield@1.2.0","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"1b6030fe8772111ab76b53567c4d1fe92eb97b8a","size":5071,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.2.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.2.0_1534807877255_0.5456455295869922"},"_hasShrinkwrap":false,"publish_time":1534807877337,"_cnpm_publish_time":1534807877337},"1.1.2":{"name":"fast-bitfield","version":"1.1.2","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"d494573951273cdbe7992a075914663754fd15e2","_id":"fast-bitfield@1.1.2","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"c692774e5d0becba3cf0525160ca4fc461298e50","size":4944,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.1.2.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.1.2_1534806561664_0.2279221394248827"},"_hasShrinkwrap":false,"publish_time":1534806561756,"_cnpm_publish_time":1534806561756},"1.1.1":{"name":"fast-bitfield","version":"1.1.1","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"ce1d9e146d2368ac0eb980402925d2cc4abe16a1","_id":"fast-bitfield@1.1.1","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"6c8a6d5bdb9445d3d44a97a51bdffbce6ba5151d","size":4933,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.1.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.1.1_1534802917990_0.509099025802713"},"_hasShrinkwrap":false,"publish_time":1534802918092,"_cnpm_publish_time":1534802918092},"1.1.0":{"name":"fast-bitfield","version":"1.1.0","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"fe414f292a6431f09609c1740fd4cdaba9041cc7","_id":"fast-bitfield@1.1.0","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"969c0ff845b9da72e0862a85874702c8aa7ada9d","size":4889,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.1.0_1534789840269_0.5291930057307468"},"_hasShrinkwrap":false,"publish_time":1534789840428,"_cnpm_publish_time":1534789840428},"1.0.1":{"name":"fast-bitfield","version":"1.0.1","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"e0b6d6bea3b9c98ce4e49c4fb5c0be51246887e4","_id":"fast-bitfield@1.0.1","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"7789b40813ded2c2f9e678aee58bcbedfd1da82e","size":3791,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.0.1_1534523833223_0.7655866173812031"},"_hasShrinkwrap":false,"publish_time":1534523833339,"_cnpm_publish_time":1534523833339},"1.0.0":{"name":"fast-bitfield","version":"1.0.0","description":"Variable sized bitfield that allows you to quickly iterate over bits","main":"index.js","dependencies":{},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/fast-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"homepage":"https://github.com/mafintosh/fast-bitfield","gitHead":"68ce12b74fdc19f6ddaf2ab9774f282fe8a7feab","_id":"fast-bitfield@1.0.0","_npmVersion":"6.2.0","_nodeVersion":"10.8.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"30821aec306af5b166354376cdc81ef492b7255a","size":3684,"noattachment":false,"key":"/fast-bitfield/-/fast-bitfield-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/fast-bitfield/download/fast-bitfield-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/fast-bitfield_1.0.0_1534438853433_0.5424199617372116"},"_hasShrinkwrap":false,"publish_time":1534438853532,"_cnpm_publish_time":1534438853532}},"readme":"# fast-bitfield\n\nA variable sized bitfield (based on [indexed-bitfield](https://github.com/mafintosh/indexed-bitfield)) that allows\nyou to quickly iterate over the bits.\n\n```\nnpm install sparse-indexed-bitfield\n```\n\nAllocates a series of ~4kb bitfields (when needed) to store the underlying data efficiently.\n\n## Usage\n\n``` js\nconst bitfield = require('fast-bitfield')\n\nconst bits = bitfield()\n\nbits.set(1000, true)\nbits.set(1000000000, true)\n\nconst ite = bits.iterator()\n\nconsole.log(ite.next(true)) // 1000\nconsole.log(ite.next(true)) // 1000000000\nconsole.log(ite.next(true)) // -1\n```\n\n## API\n\n#### `bits = bitfield()`\n\nMake a new fast bitfield\n\n#### `updated = bits.set(index, bool)`\n\nSet a bit.\n\nRuns in `O(log32(maxBitIndex))` worst case but often `O(1)`\n\n#### `bool = bits.get(index)`\n\nGet a bit.\n\nRuns in `O(log32(maxBitIndex))`\n\n#### `bits.fill(val, [start], [end])`\n\nSet a range of bits efficiently.\n\n#### `iterator = bits.iterator()`\n\nMake a new bit iterator.\n\n#### `iterator.seek(index)`\n\nMove the iterator to start at `index`.\n\nRuns in `O(log32(maxBitIndex))`\n\n#### `index = iterator.next(bit)`\n\nReturns the index of the next `bit` and -1 if none can be found.\n\nRuns in `O(log32(distanceToNextBit))`\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/fast-bitfield","bugs":{"url":"https://github.com/mafintosh/fast-bitfield/issues"},"license":"MIT"}