{"name":"hash-base","version":"3.0.5","keywords":["hash","stream"],"author":{"url":"https://github.com/fanatid","name":"Kirill Fomichev","email":"fanatid@ya.ru"},"license":"MIT","_id":"hash-base@3.0.5","maintainers":[{"name":"ljharb","email":"ljharb@gmail.com"},{"name":"dcousens","email":"npm2023@dcousens.com"},{"name":"cwmma","email":"calvin.metcalf@gmail.com"},{"name":"fanatid","email":"fanatid@ya.ru"}],"homepage":"https://github.com/crypto-browserify/hash-base","bugs":{"url":"https://github.com/crypto-browserify/hash-base/issues"},"dist":{"shasum":"52480e285395cf7fba17dc4c9e47acdc7f248a8a","tarball":"http://registry-npm.ywwl.com/hash-base/download/hash-base-3.0.5.tgz","fileCount":4,"integrity":"sha512-vXm0l45VbcHEVlTCzs8M+s0VeYsB2lnlAaThoLKGXr3bE/VWDOelNUnycUPEhKEaXARL2TEFjBOyUiM6+55KBg==","signatures":[{"sig":"MEUCIDXLrmDMI7kHUG4pmio94SXvbytedzzw2MEeomQmTby3AiEAri9Bqqa10gkSi3Y47OqJENaiIFy3+2O6kGDO1OkuD48=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":7663,"size":3270,"noattachment":false,"key":"/hash-base/-/hash-base-3.0.5.tgz"},"main":"index.js","engines":{"node":">= 0.10"},"gitHead":"7d71823f372d5768dff1aa3e742f2829d3e5d111","scripts":{"lint":"standard","test":"npm run tests-only","pretest":"npm run lint","posttest":"npx npm@'>=10.2' audit --production","tests-only":"nyc tape 'test/**/*.js'"},"_npmUser":{"name":"ljharb","email":"ljharb@gmail.com"},"repository":{"url":"git+https://github.com/crypto-browserify/hash-base.git","type":"git"},"_npmVersion":"10.9.0","description":"abstract base class for hash-streams","directories":{},"_nodeVersion":"23.2.0","dependencies":{"inherits":"^2.0.4","safe-buffer":"^5.2.1"},"_hasShrinkwrap":false,"readmeFilename":"README.md","devDependencies":{"nyc":"^10.3.2","tape":"^5.9.0","standard":"^14.3.3"},"_npmOperationalInternal":{"tmp":"tmp/hash-base_3.0.5_1732435106652_0.9002551446011262","host":"s3://npm-registry-packages"},"readme":"# hash-base\n\n[![npm Package](https://img.shields.io/npm/v/hash-base.svg?style=flat-square)](https://www.npmjs.org/package/hash-base)\n[![Build Status](https://img.shields.io/travis/crypto-browserify/hash-base.svg?branch=master&style=flat-square)](https://travis-ci.org/crypto-browserify/hash-base)\n[![Dependency status](https://img.shields.io/david/crypto-browserify/hash-base.svg?style=flat-square)](https://david-dm.org/crypto-browserify/hash-base#info=dependencies)\n\nAbstract base class to inherit from if you want to create streams implementing the same API as node crypto [Hash][1] (for [Cipher][2] / [Decipher][3] check [crypto-browserify/cipher-base][4]).\n\n## Example\n\n```js\nconst HashBase = require('hash-base');\nconst inherits = require('inherits');\n\n// our hash function is XOR sum of all bytes\nfunction MyHash () {\n\tHashBase.call(this, 1); // in bytes\n\n\tthis._sum = 0x00;\n};\n\ninherits(MyHash, HashBase)\n\nMyHash.prototype._update = function () {\n\tfor (let i = 0; i < this._block.length; ++i) {\n\t\tthis._sum ^= this._block[i];\n\t}\n};\n\nMyHash.prototype._digest = function () {\n\treturn this._sum;\n};\n\nconst data = Buffer.from([0x00, 0x42, 0x01]);\nconst hash = new MyHash().update(data).digest();\nconsole.log(hash); // => 67\n```\nYou also can check [source code](index.js) or [crypto-browserify/md5.js][5]\n\n## LICENSE\n\nMIT\n\n[1]: https://nodejs.org/api/crypto.html#crypto_class_hash\n[2]: https://nodejs.org/api/crypto.html#crypto_class_cipher\n[3]: https://nodejs.org/api/crypto.html#crypto_class_decipher\n[4]: https://github.com/crypto-browserify/cipher-base\n[5]: https://github.com/crypto-browserify/md5.js\n","publish_time":1732435106829,"_cnpm_publish_time":1732435106829,"dist-tags":{"3.0-latest":"3.0.5","latest":"3.1.2"}}