{"name":"sha256-wasm","version":"2.2.0","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","sha-test":"^1.1.0","tape":"^4.13.0","wat2js":"^2.1.1","wat2wasm":"^3.0.0"},"gitHead":"6cfa2e6f57d33767edfc05261563b353dd46bf1f","_id":"sha256-wasm@2.2.0","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-PpKy6gOxBOO+JchUcv6GZ3ha0TF13/bZgljBylLoR4NwLQgPBGwvX7q8myBhuIE6LPt8MCmEvtOeOuBsOJfydw==","shasum":"fe28443219911fa467cb931ac29c60dfb73995dc","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-2.2.0.tgz","fileCount":6,"unpackedSize":15342,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgiVVVCRA9TVsSAnZWagAAwFYP/iNtNSaBa5aBE0ynFbiO\nxZnUNVCJB3dYb+wj7RJv8L/+QnwM2AQaNueRDspHGuj89uPqS0GjUk3+/l9a\nUNpgwXy9Rrd/7LbKgirIt9Qzzr0MDkUrgbkEp8odLUqtJO7he1XIq2opFd2h\ntEBuP8aBP7l0n2sigdONnMA0xP7eHOZ4cErB7TWxAvLXjEot9LYi4sWpVWPb\n+NO8v8Zhhb0ojGq7bm2nGY//rwGmDrmFOgpnxaefnSVuFdX/Sb2uMf0fB5TQ\nCDN12krfeQDnX2a/xcaClOYdLTIpEQIHAQ6dbwwzAb6Yt18N1TdUU6f/xtkV\n4Z/pAmz4L6flQzFTuS3IpJs9WTC41PlELyNRxjx7IgyU3LSsa6loVQmgCrjN\neZg3d4sCJzOfnttUyB4QOgyDcQtIv/b0NBhKqo1/55cNboVSQntM1pohGMX6\n1BxYtrma0U3p9eaJigV93pzw9qpLaWmqkjYJJ7+FjbgwL1mCcEMc83BOlhlW\nzsmDCsdfR5lLEwvUmhWM/caFl7UF0TXpusE70Nsn6OVa5YluJwM25L8bya2U\nsvM6WiVYKNl4E4u8f5pQKLRCdbSmPD3Z43BDOelbEsW0g6HkwgHdEa8gMK+A\nIxnq3ecwzPzq2dU8KoZJSajPw3KH/Aw9pAJgUNhtzQGFvgz1FWiz6fFhcIIr\nwyEo\r\n=YpEF\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCH0Jrb1fX/dae8DbvpXstQBYXhvMbDitwAbZKELxOoj0CIQCPTI+hzJU8TFR+EG2dfwJOkqsV2bQ+RG5kUygBpRncrQ=="}],"size":6957,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-2.2.0.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.0_1619613013381_0.9838489828698422"},"_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":1619613013533,"_cnpm_publish_time":1619613013533,"dist-tags":{"latest":"2.2.2"}}