{"name":"sha256-wasm","version":"2.2.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","sha-test":"^1.1.0","tape":"^4.13.0","wat2js":"^2.1.1","wat2wasm":"^3.0.0"},"gitHead":"8e94c8ef9e4a6086a3efff32aa2fc26f7dc27b9f","_id":"sha256-wasm@2.2.1","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-OkqDgOpo86LzdWlpYVC/MfcQ1jytfR/wxPsGFJTWeEIyLaJg4spZTNQ40vuhYsLNDFidxqvMGae6u9VirkgqqA==","shasum":"6a099e369e5efa1dc3fd53731447d7a06a6f0854","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-2.2.1.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\nwsFcBAEBCAAQBQJgiVxwCRA9TVsSAnZWagAAR78P/1tWxjJG5/gu5+tq2cjH\n8p518YZen54ke5XIokPcVmOsZkRm2Pv9Y2Cv4D1/cIpgLGmEtuxnwfa1noIs\nfvPqjc4U0c0GD8mYgRXgs1G5IQDCIvjrZbYrw07RXXVZrurXUrlEGyMa4INc\nUseudLGBaIIRXX7j/Ug6HAC/Q1rEXDcb6z5Ozf+visDxnDnYDPEx4yJHkjig\n9IpEIRf0i2bYwjDT2VOgySZ0oOTATZXTpgVoOASn11Jd8giVo+I5VBOg/Foc\nGymHnINuYB9Xdp0nKvSLkcXvjOx9qfCbe1a4lwZHAfcoRx+gt18ttNxp1AXB\nLCuTJwJEwNAJtWHP2t3SDAN25wKNA8cLTWhcxOHaMhL4oCFcvHqSZCVminoy\nPESvbR1mO6VF/B4v208IRxLz1HHkMfdwHBZMMV4A+pMk2ASOeJKtS0b0lPDD\n0auS/lcW5/pYJ4HGZzeH9clO7J1oA8hUtP/lgGUM6/upafH6hTua4vjvpsvl\ny7Go0BGnKlppFTGaqFUUgr+K3d5hhCrES1XDtNejOLFymK4ej16pWOYv2y5M\nNqW9CqUakym9CtTAK2t5kKn2SUALpmJtt5ORFIS/8BPLZJ2H9Z9cBQwXiiIo\n54JFUuLCwnidsHkI+Tm7Z+TWd9gH9vJQBlLYmvl7L/S9QGqhnlnWN2TveQH0\nqNbY\r\n=c477\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC+72wQUBKMl0ke4w0G48yYsFgZrAord4qr3OrVGHLgJQIgTK3qCXnI+KHeTCtxEpm2L25CJ9hn1wHPEqGqLLa5laQ="}],"size":6961,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-2.2.1.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.1_1619614832113_0.9542447259001647"},"_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":1619614832228,"_cnpm_publish_time":1619614832228,"dist-tags":{"latest":"2.2.2"}}