{"name":"sha256-wasm","version":"2.2.2","description":"WebAssembly implementation of SHA-256","main":"index.js","scripts":{"test":"node test","compile":"wasm-to-js -sf cjs sha256.wat > sha256.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":{"b4a":"^1.0.1","nanoassert":"^2.0.0"},"devDependencies":{"js-sha256":"^0.9.0","sha-test":"^1.1.0","tape":"^4.13.0","wasm-tools":"^0.2.0"},"gitHead":"246028a6b771540027ea8547700d6ce486c1f77a","_id":"sha256-wasm@2.2.2","_nodeVersion":"14.17.3","_npmVersion":"6.14.13","dist":{"integrity":"sha512-qKSGARvao+JQlFiA+sjJZhJ/61gmW/3aNLblB2rsgIxDlDxsJPHo8a1seXj12oKtuHVgJSJJ7QEGBUYQN741lQ==","shasum":"4940b6c9ba28f3f08b700efce587ef36d4d516d4","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-2.2.2.tgz","fileCount":6,"unpackedSize":13168,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh262rCRA9TVsSAnZWagAAnY0P/0ultbFb5UU4c2O3R+nH\nhvbnFQJlFJ4/HkccfYqbAg9I8a0U04GbRRDnJ8Q1YU+tSKQwGlTFhvScPdaN\nCbLmR3Pk0c2f5yjdW9FLau9iv6LLl/qSyKO+rHGEZC9W7/8i458CEBY2qTSv\nlhLhGG3SwjuZ3C5g6s9ueSOGuO0MXjBNhbtHWzbH87pN5ane0CR7V+HK26+Y\nMIcX1NnkpkE12bNGn8JpZl2cauWt6YoH/c3s7lvRPBDMATkWmf6gVEVMMdgw\nTD6V0ywyouBLwSTgck/3vuHzXYouTMn7UradjcgNR+upaWfyKeXqrzBdQlVB\nqZ1CXTKKVT7nUXIXzbeIIrBBGSjjNVuTXa8PcqbmixB08ui0D9s0BZ2/k7QZ\nyA5x3UM4bGDLyVfDjixOPGjMO45nJLA4wIw2Fds+9hNHT+Bnivd55WCk5xX5\n6SKkllHbhNaMAfMrdaAbL2jvNdtd/gkIEPbfQlQfWmKt5xqOZeTNEdnRHczQ\n85LETHCJX++2m0296ROwBoN6qu/EZiVWJx8ihGYSxetvgGYs3uoUXXaj4voC\nx1HBq8BJFBn/a37T4rp6gr0gXztzmH9qXBR9GY5Q1nMf2VBEvp3rWy+GxhgY\n9pwZk2sXHp9z68auLq4JcGvTmtGpg5mrInYhGxfXX6/5ouDqYmoDexvyHJOG\nEVja\r\n=LtcI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICInz1wMpzkUvv4Odowl68Fbu3YGvD8M0f0MIC9INiZKAiB6q2B06q5gnyLf8/wmA0Hr1rG53QMynQeStMY29fa8Aw=="}],"size":6084,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-2.2.2.tgz"},"_npmUser":{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"},"directories":{},"maintainers":[{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sha256-wasm_2.2.2_1635157426203_0.5866848104377069"},"_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":1635157426389,"_cnpm_publish_time":1635157426389,"dist-tags":{"latest":"2.2.2"}}