{"_id":"bit-encode","_rev":"239291","name":"bit-encode","description":"Low level bit encoder for buffers","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2023-03-24T16:53:56.000Z","created":"2016-08-06T12:20:06.787Z","1.0.0":"2016-08-06T12:20:06.787Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/bit-encode.git"},"versions":{"1.0.0":{"name":"bit-encode","version":"1.0.0","description":"Low level bit encoder for buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^7.1.2","tape":"^4.6.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/bit-encode.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/bit-encode/issues"},"homepage":"https://github.com/mafintosh/bit-encode","gitHead":"97400f54f00926acc42946580d02804a27128cdd","_id":"bit-encode@1.0.0","_shasum":"79d096ed56cdf0b923640bae6fb0dd43c7bbd0a6","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"79d096ed56cdf0b923640bae6fb0dd43c7bbd0a6","size":2048,"noattachment":false,"key":"/bit-encode/-/bit-encode-1.0.0.tgz","tarball":"http://name.csiicloud.com:7001/bit-encode/download/bit-encode-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/bit-encode-1.0.0.tgz_1470486004842_0.46149680367670953"},"directories":{},"publish_time":1470486006787,"_hasShrinkwrap":false,"_cnpm_publish_time":1470486006787,"_cnpmcore_publish_time":"2021-12-13T13:49:45.875Z"}},"readme":"# bit-encode\n\nLow level bit encoder for buffers\n\n```\nnpm install bit-encode\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/bit-encode.svg?style=flat)](http://travis-ci.org/mafintosh/bit-encode)\n\n## Usage\n\n``` js\nvar bits = require('bit-encode')\n\nvar buf = Buffer([0])\n\nconsole.log(bits.get(buf, 0)) // get first bit, returns false (0)\n\nbits.set(buf, 0, true) // set first bit\n\nconsole.log(bits.get(buf, 0)) // get first bit, returns true (1)\n```\n\n## API\n\n#### `var bool = bits.get(buffer, index)`\n\nRead the bit at index. A byte in the buffer contains 8 bits so index 0 would return the first bit in the first byte and index 8 would return the first bit in the second byte.\n\n#### `var updated = bits.set(buffer, index, bool)`\n\nSet the bit at index. Returns true if a bit was updated false otherwise.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/bit-encode","bugs":{"url":"https://github.com/mafintosh/bit-encode/issues"},"license":"MIT"}