{"name":"sha256-wasm","version":"2.0.1","description":"WebAssembly implementation of SHA-256","main":"index.js","scripts":{"test":"node test"},"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","tape":"^4.13.0","wat2js":"^2.1.1","wat2wasm":"^3.0.0"},"gitHead":"329e036f456eb9cf009224649a518a22ebcc3540","_id":"sha256-wasm@2.0.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-g0BCgvSfImRnq6B73BjrY6jKi5kaiYQP5fELAWpkdDq+3q3sAUSV4ODOOS2Q5vBVtKnfZvIerHF3orxlH4up7Q==","shasum":"947a2b1ba2850899f08dd896a8d137c8d4ba7627","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-2.0.1.tgz","fileCount":8,"unpackedSize":476357,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/edBCRA9TVsSAnZWagAA+kcP/3m52/IrSnHE2jehV+Sn\nbG3cLsJiiFDEp+3EuKQY2Lc2sE6DikbpWfglj9HNyQwWAzFmyB/Cu65rjOV1\n6yQZtnp4Lj7RTeu7Laokz8yTq/9ZCvyofK8DOgojUy0VPq2BQ283BrUiSSdY\nherlj8h3RiEcevRj8S87pD0OG3GeqieIAhaVyY6XeTBO/7MH2x6YELqm2nt3\nbnuI+X+5P/bxFGzVpGBuLP7IVX3AEo1fvLU+ov3EJCfEUNbHR96I1lYPrSjx\nW31s5IfC1z2fFZSRB+dVhgrf8/a4Uy9D3luw0k2NjpWMBOaF+KJcPWKtiCAD\n7BnvdFCGjHMnr5Dn7WTUvTevGJMo/hYMJTU/3eyiiwO+ivSj8fgazE3CMsj8\nx3/voQajjcGvpdpI6v1ScOIPbkIvk5tP9bAV67AR/rK2gfpw8vTNyfkKWYxa\nwDkE/1TeYo8HYbgsyzSSkV9A715FDLqtnLkNrP6mY2W0vyKxGrz1Yt1r0ZvW\nUYY5FyFWFpZ/w72lvofG8+BOcfc7qVDeHK/Ruv2+0h/0zTX9ed1Uc1j2A/7s\n5EcZbQphghhJiI97eqPg1Zh9bn1OMpuNj5SGGFoIM3MruAfwlxNW3R02ZrHm\nAQsRB/SBFVqgPdC+F/Vkvs0hUQM6KhB6RoTMQC7oFXgaNFURs9ybbS7jwKZR\niHtT\r\n=PBk+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCp8jk/E4CIL6dhO9swVbDRpCyYvZaut3AiyW8oaBoadAIhAPU4OmeI0rf5DTHSxh+oLb4YAByxF2GwAAixD649Zp5L"}],"size":66887,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-2.0.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_2.0.1_1593698113114_0.19313943430352043"},"_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":1593698113246,"_cnpm_publish_time":1593698113246,"dist-tags":{"latest":"2.2.2"}}