{"_id":"sparse-bitfield","_rev":"237436","name":"sparse-bitfield","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","dist-tags":{"latest":"3.0.3"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"time":{"modified":"2023-03-24T16:39:08.000Z","created":"2016-03-30T18:39:02.848Z","3.0.3":"2017-03-05T00:17:45.769Z","3.0.2":"2017-03-03T15:26:31.876Z","3.0.1":"2017-03-03T15:08:31.757Z","3.0.0":"2017-03-03T14:53:52.971Z","2.2.0":"2017-02-19T13:33:07.266Z","2.1.0":"2017-01-31T23:11:02.275Z","2.0.2":"2017-01-27T18:59:40.620Z","2.0.1":"2016-11-20T21:23:56.368Z","2.0.0":"2016-11-20T21:21:01.921Z","1.0.0":"2016-03-30T18:39:02.848Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"versions":{"3.0.3":{"name":"sparse-bitfield","version":"3.0.3","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"memory-pager":"^1.0.2"},"devDependencies":{"buffer-alloc":"^1.1.0","standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"922ad0e94c4134fa1de17ae456551f950eef528f","_id":"sparse-bitfield@3.0.3","_shasum":"ff4ae6e68656056ba4b3e792ab3334d38273ca11","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"ff4ae6e68656056ba4b3e792ab3334d38273ca11","size":3146,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-3.0.3.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sparse-bitfield-3.0.3.tgz_1488673063925_0.47190379025414586"},"directories":{},"publish_time":1488673065769,"_hasShrinkwrap":false,"_cnpm_publish_time":1488673065769,"_cnpmcore_publish_time":"2021-12-13T12:59:49.958Z"},"3.0.2":{"name":"sparse-bitfield","version":"3.0.2","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"memory-pager":"^1.0.2"},"devDependencies":{"buffer-alloc":"^1.1.0","standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"e7260989affdc63de82e9a741777e41d8a86918b","_id":"sparse-bitfield@3.0.2","_shasum":"09ed0965f0b6cad0e5255dd44c08690bfc23f6a7","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"09ed0965f0b6cad0e5255dd44c08690bfc23f6a7","size":3135,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-3.0.2.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-3.0.2.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/sparse-bitfield-3.0.2.tgz_1488554791261_0.6982960747554898"},"directories":{},"publish_time":1488554791876,"_hasShrinkwrap":false,"_cnpm_publish_time":1488554791876,"_cnpmcore_publish_time":"2021-12-13T12:59:50.260Z"},"3.0.1":{"name":"sparse-bitfield","version":"3.0.1","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"memory-pager":"^1.0.2"},"devDependencies":{"buffer-alloc":"^1.1.0","standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"baa1fdac27b2f08d9a49c7bac850a90fa0f51b17","_id":"sparse-bitfield@3.0.1","_shasum":"7917c3d5372ba9ae2a37d7c1d2b73019bc376ff9","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"7917c3d5372ba9ae2a37d7c1d2b73019bc376ff9","size":3130,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-3.0.1.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-3.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/sparse-bitfield-3.0.1.tgz_1488553711169_0.5104664450045675"},"directories":{},"publish_time":1488553711757,"_hasShrinkwrap":false,"_cnpm_publish_time":1488553711757,"_cnpmcore_publish_time":"2021-12-13T12:59:50.519Z"},"3.0.0":{"name":"sparse-bitfield","version":"3.0.0","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"memory-pager":"^1.0.2"},"devDependencies":{"standard":"^9.0.0","tape":"^4.6.3"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"72294997290ae01885fde8c922033fe827cfc034","_id":"sparse-bitfield@3.0.0","_shasum":"549d54835ae7f00631654af35242cc70ce090842","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"549d54835ae7f00631654af35242cc70ce090842","size":3118,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-3.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sparse-bitfield-3.0.0.tgz_1488552831183_0.8495832744520158"},"directories":{},"publish_time":1488552832971,"_hasShrinkwrap":false,"_cnpm_publish_time":1488552832971,"_cnpmcore_publish_time":"2021-12-13T12:59:50.845Z"},"2.2.0":{"name":"sparse-bitfield","version":"2.2.0","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"bit-encode":"^1.0.0","buffer-alloc":"^1.1.0"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"f3663042719d3d4c020de6919c29c75bbf1c2ef2","_id":"sparse-bitfield@2.2.0","_shasum":"d47d0deeadeb36d596cc63469010d5e6ae1ab26f","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.9.5","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"d47d0deeadeb36d596cc63469010d5e6ae1ab26f","size":3581,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-2.2.0.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-2.2.0.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sparse-bitfield-2.2.0.tgz_1487511185448_0.7530862623825669"},"directories":{},"publish_time":1487511187266,"_hasShrinkwrap":false,"_cnpm_publish_time":1487511187266,"_cnpmcore_publish_time":"2021-12-13T12:59:51.154Z"},"2.1.0":{"name":"sparse-bitfield","version":"2.1.0","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"bit-encode":"^1.0.0","buffer-alloc":"^1.1.0"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"a052a304eb64211fe8ba504dcb6958bd19e8f83d","_id":"sparse-bitfield@2.1.0","_shasum":"dfdadca8e9f570270b511d51263116edb5d738b5","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.2","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"dfdadca8e9f570270b511d51263116edb5d738b5","size":3524,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-2.1.0.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-2.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sparse-bitfield-2.1.0.tgz_1485904262058_0.4372378238476813"},"directories":{},"publish_time":1485904262275,"_hasShrinkwrap":false,"_cnpm_publish_time":1485904262275,"_cnpmcore_publish_time":"2021-12-13T12:59:51.503Z"},"2.0.2":{"name":"sparse-bitfield","version":"2.0.2","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"bit-encode":"^1.0.0","safe-buffer":"^5.0.1"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"f777cf02e747851d82cc8708479455e39d6920a1","_id":"sparse-bitfield@2.0.2","_shasum":"7132f50732b0945860687242e29a5b43c76fca40","_from":".","_npmVersion":"2.15.11","_nodeVersion":"4.7.2","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"7132f50732b0945860687242e29a5b43c76fca40","size":3380,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-2.0.2.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-2.0.2.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/sparse-bitfield-2.0.2.tgz_1485543580102_0.6158453912939876"},"directories":{},"publish_time":1485543580620,"_hasShrinkwrap":false,"_cnpm_publish_time":1485543580620,"_cnpmcore_publish_time":"2021-12-13T12:59:51.852Z"},"2.0.1":{"name":"sparse-bitfield","version":"2.0.1","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"bit-encode":"^1.0.0","safe-buffer":"^5.0.1"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"06b614f3a52075d163e51e58a15f7d6ea6050d8c","_id":"sparse-bitfield@2.0.1","_shasum":"bbb02e398ebb47dcebd947260b2baa7014142eeb","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"bbb02e398ebb47dcebd947260b2baa7014142eeb","size":3402,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-2.0.1.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-2.0.1.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/sparse-bitfield-2.0.1.tgz_1479677035788_0.576625800691545"},"directories":{},"publish_time":1479677036368,"_hasShrinkwrap":false,"_cnpm_publish_time":1479677036368,"_cnpmcore_publish_time":"2021-12-13T12:59:52.179Z"},"2.0.0":{"name":"sparse-bitfield","version":"2.0.0","description":"Bitfield that allocates a series of small buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{"safe-buffer":"^5.0.1"},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"63019cf21e0c25f4d62fe8f5f9dabf2f40064958","_id":"sparse-bitfield@2.0.0","_shasum":"21c5f8536bd68c2ea20e8829db094f924aa4febc","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.6.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"21c5f8536bd68c2ea20e8829db094f924aa4febc","size":3392,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-2.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/sparse-bitfield-2.0.0.tgz_1479676859926_0.809617294697091"},"directories":{},"publish_time":1479676861921,"_hasShrinkwrap":false,"_cnpm_publish_time":1479676861921,"_cnpmcore_publish_time":"2021-12-13T12:59:52.612Z"},"1.0.0":{"name":"sparse-bitfield","version":"1.0.0","description":"Bitfield that allocates a series of 1kb buffers to support sparse bits without allocating a massive buffer","main":"index.js","dependencies":{},"devDependencies":{"standard":"^6.0.8","tape":"^4.5.1"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/sparse-bitfield.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"homepage":"https://github.com/mafintosh/sparse-bitfield","gitHead":"7245f6d3b6fd3a62d2408c28de8d6627420c9d56","_id":"sparse-bitfield@1.0.0","_shasum":"f15ccd0531d3ceaaab992657487185a7bf0c131e","_from":".","_npmVersion":"2.14.20","_nodeVersion":"4.4.1","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"f15ccd0531d3ceaaab992657487185a7bf0c131e","size":2647,"noattachment":false,"key":"/sparse-bitfield/-/sparse-bitfield-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/sparse-bitfield/download/sparse-bitfield-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""},{"name":"npm:mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/sparse-bitfield-1.0.0.tgz_1459363141848_0.015010863309726119"},"directories":{},"publish_time":1459363142848,"_hasShrinkwrap":false,"_cnpm_publish_time":1459363142848,"_cnpmcore_publish_time":"2021-12-13T12:59:52.985Z"}},"readme":"# sparse-bitfield\n\nBitfield implementation that allocates a series of 1kb buffers to support sparse bitfields\nwithout allocating a massive buffer. If you want to simple implementation of a flat bitfield\nsee the [bitfield](https://github.com/fb55/bitfield) module.\n\nThis module is mostly useful if you need a big bitfield where you won't nessecarily set every bit.\n\n```\nnpm install sparse-bitfield\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/sparse-bitfield.svg?style=flat)](http://travis-ci.org/mafintosh/sparse-bitfield)\n\n## Usage\n\n``` js\nvar bitfield = require('sparse-bitfield')\nvar bits = bitfield()\n\nbits.set(0, true) // set first bit\nbits.set(1, true) // set second bit\nbits.set(1000000000000, true) // set the 1.000.000.000.000th bit\n```\n\nRunning the above example will allocate two 1kb buffers internally.\nEach 1kb buffer can hold information about 8192 bits so the first one will be used to store information about the first two bits and the second will be used to store the 1.000.000.000.000th bit.\n\n## API\n\n#### `var bits = bitfield([options])`\n\nCreate a new bitfield. Options include\n\n``` js\n{\n  pageSize: 1024, // how big should the partial buffers be\n  buffer: anExistingBitfield,\n  trackUpdates: false // track when pages are being updated in the pager\n}\n```\n\n#### `bits.set(index, value)`\n\nSet a bit to true or false.\n\n#### `bits.get(index)`\n\nGet the value of a bit.\n\n#### `bits.pages`\n\nA [memory-pager](https://github.com/mafintosh/memory-pager) instance that is managing the underlying memory.\nIf you set `trackUpdates` to true in the constructor you can use `.lastUpdate()` on this instance to get the last updated memory page.\n\n#### `var buffer = bits.toBuffer()`\n\nGet a single buffer representing the entire bitfield.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/sparse-bitfield","bugs":{"url":"https://github.com/mafintosh/sparse-bitfield/issues"},"license":"MIT"}