{"_id":"hash-stream-validation","_rev":"294121","name":"hash-stream-validation","description":"Hash a stream of data, then validate","dist-tags":{"latest":"0.2.4"},"maintainers":[{"name":"stephenplusplus","email":""}],"time":{"modified":"2021-06-03T18:55:08.000Z","created":"2015-08-24T17:30:29.325Z","0.2.4":"2020-08-25T14:36:42.592Z","0.2.3":"2020-05-15T15:38:16.238Z","0.1.4":"2019-10-04T18:08:20.290Z","0.2.2":"2019-10-04T17:31:46.638Z","0.2.1":"2016-06-07T21:06:39.353Z","0.2.0":"2016-06-07T20:50:26.905Z","0.1.3":"2015-11-14T01:55:14.561Z","0.1.2":"2015-10-02T00:11:01.830Z","0.1.1":"2015-09-27T19:23:14.684Z","0.1.0":"2015-08-24T17:30:29.325Z"},"users":{},"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"versions":{"0.2.4":{"name":"hash-stream-validation","version":"0.2.4","description":"Hash a stream of data, then validate","main":"index.js","repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"fast-crc32c":"^1.0.2","mocha":"^2.2.5","standard":"^5.1.0"},"standard":{"global":["before","describe","it"]},"gitHead":"0aa27468552a2b12cff1813b5ef63ecb4e903621","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.2.4","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"shasum":"ee68b41bf822f7f44db1142ec28ba9ee7ccb7512","size":4232,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.2.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.2.4.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"_npmUser":{"name":"stephenplusplus","email":"stephenplusplusplus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-stream-validation_0.2.4_1598366202452_0.7628052316108822"},"_hasShrinkwrap":false,"publish_time":1598366202592,"_cnpm_publish_time":1598366202592},"0.2.3":{"name":"hash-stream-validation","version":"0.2.3","description":"Hash a stream of data, then validate","main":"index.js","repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"fast-crc32c":"^1.0.2","mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"3176771e88bac367802d8ccda0f464fde7489f10","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.2.3","_nodeVersion":"14.2.0","_npmVersion":"6.14.4","dist":{"shasum":"44e3479d1767c4f1d6924cc2da61eca08ebba8af","size":4215,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.2.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.2.3.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"_npmUser":{"name":"stephenplusplus","email":"stephenplusplusplus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-stream-validation_0.2.3_1589557096127_0.49837489277898284"},"_hasShrinkwrap":false,"publish_time":1589557096238,"_cnpm_publish_time":1589557096238},"0.1.4":{"name":"hash-stream-validation","version":"0.1.4","description":"Hash a stream of data, then validate","main":"index.js","repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"fast-crc32c":"^1.0.0","through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"8f7dd15d42555d1c35d5dadb110b3b92109d055f","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.1.4","_nodeVersion":"12.11.0","_npmVersion":"6.11.3","dist":{"shasum":"cd541fb4616b9203af078534a1a3b897b5872ce4","size":2035,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.1.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.1.4.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"_npmUser":{"name":"stephenplusplus","email":"stephenplusplusplus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-stream-validation_0.1.4_1570212500122_0.531988401338225"},"_hasShrinkwrap":false,"publish_time":1570212500290,"_cnpm_publish_time":1570212500290},"0.2.2":{"name":"hash-stream-validation","version":"0.2.2","description":"Hash a stream of data, then validate","main":"index.js","repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"fast-crc32c":"^1.0.2","mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"069006d04a34254f6a8afb392d6f12d149f71cd7","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.2.2","_nodeVersion":"12.11.0","_npmVersion":"6.11.3","dist":{"shasum":"6b34c4fce5e9fce265f1d3380900049d92a10090","size":4213,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.2.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.2.2.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"_npmUser":{"name":"stephenplusplus","email":"stephenplusplusplus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hash-stream-validation_0.2.2_1570210306487_0.10360448165920366"},"_hasShrinkwrap":false,"publish_time":1570210306638,"_cnpm_publish_time":1570210306638},"0.2.1":{"name":"hash-stream-validation","version":"0.2.1","description":"Hash a stream of data, then validate","main":"index.js","files":["crc32c.js","index.js"],"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"fast-crc32c":"^1.0.2","mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"63d2d6a7f821436f0f59f0ec70f3f43d3db14e9b","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.2.1","_shasum":"ecc9b997b218be5bb31298628bb807869b73dcd1","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"ecc9b997b218be5bb31298628bb807869b73dcd1","size":4226,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.2.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.2.1.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/hash-stream-validation-0.2.1.tgz_1465333596888_0.45544818602502346"},"directories":{},"publish_time":1465333599353,"_cnpm_publish_time":1465333599353,"_hasShrinkwrap":false},"0.2.0":{"name":"hash-stream-validation","version":"0.2.0","description":"Hash a stream of data, then validate","main":"index.js","files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"fast-crc32c":"^1.0.2","mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"ce7de515aa90bdb4dbe2747333228f223f3623ad","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.2.0","_shasum":"37f3469121bb6166c8ee4ca5c1780e3480f69c4e","_from":".","_npmVersion":"3.8.9","_nodeVersion":"6.2.0","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"37f3469121bb6166c8ee4ca5c1780e3480f69c4e","size":2280,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.2.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.2.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/hash-stream-validation-0.2.0.tgz_1465332624442_0.743641045410186"},"directories":{},"publish_time":1465332626905,"_cnpm_publish_time":1465332626905,"_hasShrinkwrap":false},"0.1.3":{"name":"hash-stream-validation","version":"0.1.3","description":"Hash a stream of data, then validate","main":"index.js","files":["index.js"],"repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"fast-crc32c":"^1.0.0","through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"0042623fc52347604e3d04250819f62b12a834bd","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.1.3","_shasum":"7cafc7d29d3a28822a6dbe4c951066e541ed1ab9","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0-rc.1","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"7cafc7d29d3a28822a6dbe4c951066e541ed1ab9","size":2064,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.1.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.1.3.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1447466114561,"_cnpm_publish_time":1447466114561,"_hasShrinkwrap":false},"0.1.2":{"name":"hash-stream-validation","version":"0.1.2","description":"Hash a stream of data, then validate","main":"index.js","repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"fast-crc32c":"^1.0.0","through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"4880919ef6fbe1c25bf9cb14b6e266e5d4e14a50","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.1.2","_shasum":"368bb7c656350fb5e24cd691d38c9eabfd06c823","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0-rc.1","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"368bb7c656350fb5e24cd691d38c9eabfd06c823","size":1683,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.1.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.1.2.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1443744661830,"_cnpm_publish_time":1443744661830,"_hasShrinkwrap":false},"0.1.1":{"name":"hash-stream-validation","version":"0.1.1","description":"Hash a stream of data, then validate","main":"index.js","repository":{"type":"git","url":"git+https://github.com/stephenplusplus/hash-stream-validation.git"},"scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation","crc32c","crc32","md5"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"fast-crc32c":"^0.1.5","through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"899f94d03a36fab1c8bf0e923376e417e91070d1","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","_id":"hash-stream-validation@0.1.1","_shasum":"6bc4bec51e3db48d7dda4be4ab5e99a2398b4a75","_from":".","_npmVersion":"2.14.2","_nodeVersion":"4.0.0-rc.1","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"6bc4bec51e3db48d7dda4be4ab5e99a2398b4a75","size":1685,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.1.1.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1443381794684,"_cnpm_publish_time":1443381794684,"_hasShrinkwrap":false},"0.1.0":{"name":"hash-stream-validation","version":"0.1.0","description":"Hash a stream of data, then validate","main":"index.js","scripts":{"test":"mocha"},"keywords":["hash","stream","algorithm","validation"],"author":{"name":"Stephen Sawchuk","email":"sawchuk@gmail.com"},"license":"MIT","devDependencies":{"mocha":"^2.2.5","standard":"^5.1.0"},"dependencies":{"sse4_crc32":"^4.0.1","through2":"^2.0.0"},"standard":{"global":["before","describe","it"]},"gitHead":"87dc46e8b4a9da8c30abf1e5f7c4fb2d32f423c5","_id":"hash-stream-validation@0.1.0","_shasum":"5b32c38860c1de0ca373b25838c69b701e206ed5","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"stephenplusplus","email":"sawchuk@gmail.com"},"dist":{"shasum":"5b32c38860c1de0ca373b25838c69b701e206ed5","size":1645,"noattachment":false,"key":"/hash-stream-validation/-/hash-stream-validation-0.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hash-stream-validation/download/hash-stream-validation-0.1.0.tgz"},"maintainers":[{"name":"stephenplusplus","email":""}],"directories":{},"publish_time":1440437429325,"_cnpm_publish_time":1440437429325,"_hasShrinkwrap":false}},"readme":"# hash-stream-validation\n> Hash a stream of data, then validate\n\n```sh\n$ npm install --save hash-stream-validation\n```\n```js\nvar hashStreamValidation = require('hash-stream-validation');\n\nvar validateStream = hashStreamValidation();\n\nfs.createReadStream(filePath)\n  .pipe(validateStream)\n  .on('data', function() { /*... */ })\n  .on('end', function() {\n    validateStream.test('md5', /*checksum*/);\n  });\n```\n\n## Do this for faster crc32c computation\n\nIf the speeds are too slow for your use, this module will `try` to require [`fast-crc32c`](http://gitnpm.com/fast-crc32c). We chose not to make it an `optionalDependency` because npm's scary warning output confuses users into thinking their hard drive was just erased.\n\n\n```js\n$ npm install --save fast-crc32c\n```\n\n## Use Case\n\nAfter a successful upload to a Google Cloud Storage bucket, the API will respond with the hash of data it has received. During our upload, we can run the data through this module, then confirm after the upload if we both arrived at the same results. If not, we know something went wrong during the transmission.\n\n## API\n\n### validateStream = hashStreamValidation([opts])\n\n#### opts.crc32c\n- Type: `Boolean`\n- Default: `true`\n\nEnable crc32c hashing via [sse4_crc32](https://gitnpm.com/sse4_crc32).*\n\n* Note: Any issues installing this module on your system should be opened at their repository.\n\n#### opts.md5\n- Type: `Boolean`\n- Default: `true`\n\nEnable MD5 hashing.\n\n### validateStream.test(algo, sum)\n\n#### algo\n- Type: `String`\n\nThe alogrithm to test the sum against ('crc32c' or 'md5').\n\n#### sum\n- Type: `String`\n\nThe base64-encoded sum to validate.\n","_attachments":{},"homepage":"https://github.com/stephenplusplus/hash-stream-validation#readme","bugs":{"url":"https://github.com/stephenplusplus/hash-stream-validation/issues"},"license":"MIT"}