{"name":"butils","version":"0.0.5","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.5","dist":{"shasum":"c16eec9f0664b8b771d7763f581a3c49e89a45fa","tarball":"http://registry-npm.ywwl.com/butils/download/butils-0.0.5.tgz","integrity":"sha512-54MFqXmSDJaIHPieOdEN4jISbnCUwqW/nGLsCbpebaFwYWhU7GSkj5reU78r9/qMnWqErJjWv557gdXSqfPS2A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBXvf4dDkqQwUxMRMUojd/Iw51c3WK3xpchUM1xYEum0AiBI/qj7KhWr/yuwiE62e8N4u9L0ipHdXnFKgIJoesgIoA=="}],"size":2070,"noattachment":false,"key":"/butils/-/butils-0.0.5.tgz"},"_from":".","_npmVersion":"1.3.2","_npmUser":{"name":"nlf","email":"quitlahok@gmail.com"},"maintainers":[{"name":"nathan-lafreniere","email":"quitlahok@gmail.com"},{"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":1375984387440,"_cnpm_publish_time":1375984387440,"dist-tags":{"latest":"0.1.0"}}