{"name":"framed-hash","version":"1.0.0","description":"WIP - nothing to see here","main":"index.js","dependencies":{},"devDependencies":{"tape":"^4.0.0"},"scripts":{"test":"tape test.js"},"repository":{"type":"git","url":"https://github.com/mafintosh/framed-hash.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/framed-hash/issues"},"homepage":"https://github.com/mafintosh/framed-hash","gitHead":"a56336cc156c1c66d248aaaf04d644919782f9db","_id":"framed-hash@1.0.0","_shasum":"0feb01b0a2a9f39f4fbeee730a29b2654ac76287","_from":".","_npmVersion":"2.10.1","_nodeVersion":"2.1.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"dist":{"shasum":"0feb01b0a2a9f39f4fbeee730a29b2654ac76287","tarball":"http://registry-npm.ywwl.com/framed-hash/download/framed-hash-1.0.0.tgz","integrity":"sha512-xMxO60+v1H1Z8d20+W/+y43HtYl3WmScOiH7wQId34nMJKwwphvkieK3JZLVZ88F8j9p4bMBmk3wLCTq6mqIDA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9xIehamQs5FPyLXJ++K0od6jieaW/uqhnqyBvrNOqsQIgM9sMeI9QdxOZnvwi99EySh9onNNJTU0dFfUSXHAUjQk="}],"size":2103,"noattachment":false,"key":"/framed-hash/-/framed-hash-1.0.0.tgz"},"directories":{},"readme":"# framed-hash\n\nA hash function that wraps all input chunks with a length prefix.\n\n```\nnpm install framed-hash\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/framed-hash.svg?style=flat)](http://travis-ci.org/mafintosh/framed-hash)\n\n## Usage\n\n``` js\nvar framedHash = require('framed-hash')\n\nvar hash = framedHash('sha256')\n\nhash.update('hello')\nhash.update('world')\n\n// prints 9054cf26016be468a8b56b40342bd5b479202a40da9fc9056b1ac4c5070343d8\nconsole.log(hash.digest('hex'))\n\nvar anotherHash = framedHash('sha256')\n\nanotherHash.update('hell')\nanotherHash.update('oworld')\n\n// prints 9cb231ff970f99993c9753364405184fc9024c3f56d98716d90f4913a6c746c0\n// since the input chunks were different\nconsole.log(anotherHash.digest('hex'))\n```\n\n## API\n\n#### `hash = framedHash(algorithm)`\n\nCreate a new hash instance. Algorithm can be anything accepted by `crypto.createHash(algo)`\n\n#### `hash.update(chunk)`\n\nUpdate the hash. Internally the chunk is prefixed with the length of the chunk and a newline\n\n#### `hash.digest(encoding)`\n\nReturns the digest of the hash.\n\n## License\n\nMIT\n","publish_time":1433600905299,"_cnpm_publish_time":1433600905299,"dist-tags":{"latest":"1.1.0"}}