{"name":"sha256-wasm","version":"1.2.1","description":"WebAssembly implementation of SHA-256","main":"index.js","scripts":{"test":"node test.js"},"repository":{"type":"git","url":"git+https://github.com/chm-diederichs/sha256-wasm.git"},"keywords":["WebAssembly","SHA-256"],"author":{"name":"Christophe Diederichs"},"license":"ISC","bugs":{"url":"https://github.com/chm-diederichs/sha256-wasm/issues"},"homepage":"https://github.com/chm-diederichs/sha256-wasm#readme","dependencies":{"nanoassert":"^2.0.0"},"devDependencies":{"js-sha256":"^0.9.0","sodium-native":"^2.4.6"},"gitHead":"7fb2a733ffc9c6f77d4e950f369b1331e460c9f4","_id":"sha256-wasm@1.2.1","_nodeVersion":"12.4.0","_npmVersion":"6.9.0","dist":{"integrity":"sha512-MW54kvCsFT4a8P2V5GeRvHQT8vYHsjVmcOBR3S/5HaTuQ3M5kSaA/CbrA5d+0QFjLwgq3Cxf6DjfC4Zd5aWnqQ==","shasum":"59574b60965cd7aca5feaa76b5c97b28f91a1cf9","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.2.1.tgz","fileCount":7,"unpackedSize":1058629,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeIvv5CRA9TVsSAnZWagAAknoP/3/huCE25OgaBBT5A1UB\niibzSnjDB1tPAcy6SGY7nIUQELl1/djgIIBTCv2VgEA5eZTQ+wiSarvEWXwn\nlY+NSivyn7SyzwDJyrcaUk3UEO2zg5UiYLxOsnN5ENxPipQGSRyKy7lunVZw\n+w3Sl3If0x1+IGu+QKf/A2soQX3UyaW9pjlW+85+Q5/6Vyc2nhwNEsYCpFar\nzTSdNnps7Uc4YzlTgJ+AHkeAWABX2ILYx/WATUfiRv/eA6fumndPK/D2mIKb\nnaOvyuK5Y2Ar46k7qFueYmO5uSsI0Iph2rsJ332Du0kz2Jdlmgj/p9KJ+QnH\n+NoOi4YDy9ebpH3o4wugpDfw0S3TdpLOxPXaPfCY4e6cJcpm/Amufj3wzjLA\n0ISSgJRbkTdSQGBoWm7QlSFnCTjpUqLUKNxmJqG7nT25e/8of68seOlKtEh8\nKPvlzeCuTvxVy6BgEv0SbfGiWhNJogfn6RDoM5JdrUhEcAjomimPbPj1Vby3\ne76G7za50uW+4U41beFXmjCYRIM8JWhUhcQYJs5l7Rxlb72qTFmYbiCMe7S4\n/JDenZsyPi+0JffahMiSaogLT+BMBgt1Ybv8S5sW8W9R66qmtxQrrLdoROA8\nQaBUAuPyJbaxJaozB4mvsRq66OePa9JYXrM2SM+1qREH56ZpOVaTWpZEX7QP\nAsOQ\r\n=VU4w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBoowX1f7s7amLOFdER+loNW657bX7+16vvgwLSszM2AAiEA28Jb8z0W2Zv724w4dctRiq+u74TMmOXyb4J/a9Frl9o="}],"size":82987,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.2.1.tgz"},"maintainers":[{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"}],"_npmUser":{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sha256-wasm_1.2.1_1579351032578_0.9766021552937179"},"_hasShrinkwrap":false,"readme":"# sha256-wasm\n## Usage\n```js\nconst sha256 = require('sha256-wasm')\n\nif (!Sha256.SUPPORTED) {\n  console.log('WebAssembly not supported by your runtime')\n}\n\nvar hash = sha256()\n  .update('hello')\n  .update(' ')\n  .update(Buffer.from('world'))\n  .digest('hex')\n\nconsole.log('Sha256 hash of \"hello world\" is ', hash)\n// b94d27b9934d3e08a52e52d7da7dabfac484efe37a5380ee9088f7ace2efcde9\n```\n\n## API\n#### `const hash = sha256()`\n\nCreate a new hash instance.\n\n#### `hash.update(data, [enc])`\n\nUpdate the hash with a new piece of data. `data` may be passed as a buffer, uint8array or a string. If `data` is passed as a string, then it will be interpreted as a `utf8` string unless `enc` specifies an encoding.\n\nSupported `enc`s are:\n- `utf8` / `utf-8` (defualt)\n- `hex`\n- `base64`\n\n#### `hash.digest([enc])`\n\nDigest the hash. If `enc` is specified, then the digest shall be returned as an `enc` encoded string. Otherwise a buffer is returned.\n\nSupported `enc`s are:\n- `utf8` / `utf-8` (defualt)\n- `hex`\n- `base64`\n\n#### `var promise = sha256.ready([cb])`\n\nWait for the WASM code to load. Returns the WebAssembly instance promise as well for convenience.\nYou have to call this at least once before instantiating the hash.\n\n## Contributing\n\nThe bulk of this module is implemented in WebAssembly in the [sha256.wat](sha256.wat) file. To build the thin Javascript wrapper do:\n\n```\nnpm run compile\n```\n\n## License\n\nMIT\n","publish_time":1579351032710,"_cnpm_publish_time":1579351032710,"dist-tags":{"latest":"2.2.2"}}