{"name":"sha256-wasm","version":"1.0.0","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":"4dc44d081c96d622cb707e7ba14b3ba1bca976cf","_id":"sha256-wasm@1.0.0","_nodeVersion":"13.6.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-kY8kiqVGcdTllx5Md6U5qEcObLdIqeM1X25BYf89nfaN59otKuxIh5LVqnTAHDRmQXBaVaLm8NqTn2MKDNgUEQ==","shasum":"07655b8be903e1ceab6967a852c65ef87c019579","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.0.0.tgz","fileCount":14,"unpackedSize":1051732,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHdTQCRA9TVsSAnZWagAAOXwP/3Ve8dbPwOpNhziOIRuI\nWi37qOKneNwg+LHQQCFvTmaXeMkIw19KGrfPck9cW/FUPkVaIBA5PzhAumWG\nVsf0Bev5DmGrZYLZUn8DJEyy606pz+GwzHGVi98ihk1PAuFIvXW4nZC4TXsz\nLyrJ9ojtJ9axminUnXlXrlMos7TAkbTPslqK7XUHiV/w4VcsoKMF4lyTTR5A\nctCYceyTLhmvJH78qYE5KKl1Qefm1bSTH3jAAPrdD6uRpjZvZTpqL3/iLUjj\nre3QzpwTGZ/xHoGDEqALJJaWIJSx5B83GxXYZCK64+tPfU/nmXEQnc2Ut6JG\nwi3WffEHrjK2penyh3vhq9fzyGutaJfW8HWR5FqYdFdTgMfBqekmkjoPgYPP\nCDhYPgDLQEWeOxW7e0R3myVWpvgK7IVfc05XrcwukDo6G7B5iqmS7Lxl53js\nmYEaOxcT+cgVMrK6uZw6R0MRqvWkZNbBb42aeYmoQBdaz1YAfl+DHIkn7TRS\neok9Y73eSwUIh0E86ub6gRyC9CTGbr+ppYzVqd4QS3DBYl3kcOew6qAJaR+r\n+Lx20bqBqwWJE7tNTojW58/5J4moSfd69ceFiq9Jfji/Gsf2MKRQfDRS2T+6\ncDTwdOFbUQV8YKPxENp0ySJDbFFaQ3wsaGvC58AifGXvYmX9e5Z1DSihPGr0\ns53W\r\n=6UGK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA5DjVkN2MgfKTU7jDk1/HZC76s2z6mE0IzAsvWKTt3uAiEAgCQ8EUHby7abx2oizvnLZ7S52Qly+UVreVjvhsgv1LA="}],"size":246770,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.0.0.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.0.0_1579013328113_0.10128792475314286"},"_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":1579013328285,"_cnpm_publish_time":1579013328285,"dist-tags":{"latest":"2.2.2"}}