{"name":"butils","version":"0.0.7","description":"helper functions to make buffers faster","main":"index.js","repository":{"type":"git","url":"git://github.com/nlf/node-butils.git"},"keywords":["buffer","ctype"],"author":{"name":"Nathan LaFreniere","email":"quitlahok@gmail.com"},"license":"MIT","devDependencies":{"audit":"0.0.6","precommit-hook":""},"bugs":{"url":"https://github.com/nlf/node-butils/issues"},"_id":"butils@0.0.7","dist":{"shasum":"c8e8dc185b8e4573e8b1aa0070c71bc74d9b280f","tarball":"http://registry-npm.ywwl.com/butils/download/butils-0.0.7.tgz","integrity":"sha512-eTK7Adfv/4cm0/gUQmUVu3ZOhNgtGZIljYIm9VRRSHGz7/Ome7jWuwHvsdu5QbznaWAbtpAFZI8EsKSROG/4eg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDo1Bg9tzYTisPx8Pylna/GqJ/Hx/W44eS5r+4uCnWCxgIgeEaPELSy2Qcbr7/qgTTX8AS9vcdt9eXxdAvwcF8naSU="}],"size":2089,"noattachment":false,"key":"/butils/-/butils-0.0.7.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"nlf","email":"quitlahok@gmail.com"},"maintainers":[{"name":"nlf","email":"quitlahok@gmail.com"}],"readme":"butils\n------\n###Bufferwise binary operations\n - getBit(buffer, offset) returns true or false\n - setBit(buffer, offset, boolean) returns the changed byte\n - XOR(buffer, buffer2) returns the modifed first buffer\n - OR(buffer, buffer2) returns the modifed first buffer\n - AND(buffer, buffer2) return the modifed first buffer\n - NOT(buffer) return the modifed buffer\n - EQUAL(buffer, buffer2) returns a boolean\n - leftShift(buffer, offset) returns a NEW buffer\n - rightShift(buffer, offset) returns a NEW buffer\n - signedRightShift(buffer, offset) returns a NEW buffer\n\n\nThese are some helper functions that appear to be significantly faster than core Buffer manipulation functions.\n\nFunctions included\n\n* readInt(buffer, offset) -- (buffer.readInt8(offset))\n* writeInt(buffer, int, offset) -- (buffer.writeInt8(int, offset))\n* readInt32(buffer, offset) -- (buffer.readUInt32BE(offset))\n* writeInt32(buffer, int, offset) -- (buffer.writeUInt32BE(int, offset))\n* readString(buffer, start, end) -- (buffer.toString(start, end))\n* writeString(buffer, str, offset) -- (Buffer.write(str, 'utf8', offset))\n* readVarint(buffer, offset) -- (no equivalent)\n* writeVarint(buffer, int, offset) -- (no equivalent)\n\nNote that the Int32 functions are currently unsigned and big endian only, though I'd happily accept pull requests to add more functionality.\n\nBenchmark\n=========\n\n100,000,000 iterations of each function. (see bench.js)\n\n* Buffer#writeInt8: 1225ms\n* butils#writeInt: 166ms\n* \n* Buffer#readInt8: 761ms\n* butils#readInt: 164ms\n* \n* Buffer#writeUInt32BE: 1544ms\n* butils#writeInt32: 257ms\n* \n* Buffer#readUInt32BE: 1525ms\n* butils#readInt32: 323ms\n* \n* Buffer#write: 45101ms\n* butils#writeString: 2509ms\n* \n* Buffer#toString: 17505ms\n* butils#readString: 7340ms\n* \n* butils#writeVarint: 1264ms\n* \n* butils#readVarint: 4777ms\n","publish_time":1388697988485,"_cnpm_publish_time":1388697988485,"dist-tags":{"latest":"0.1.0"}}