{"name":"sha256-wasm","version":"1.1.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":"8a109beebedbdfbc9913303569ee45997cca37a5","_id":"sha256-wasm@1.1.0","_nodeVersion":"13.6.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-B9/ea3z/4N4tIqViIG8k0k0fzZ647OLR48z5fbxy7nwHJjle4pW78VHNi1SpMWEj8LfuLFgx1A8smPIxvgh7BA==","shasum":"dada9322bc1f35862dd441d211b2aa85ae6b7923","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.1.0.tgz","fileCount":8,"unpackedSize":1058616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH6ZWCRA9TVsSAnZWagAAV0gP/2hRW2wrk+UyJ4W8ph61\nf22Yi/ZAWWAUCFuG9ZmBxlNgxX2kvA+43YKr4U80lW8Di1tOb2epI6I8ikEN\nBWGYG/CCnA1z+foKdbz24TFu5i5l7MkVSaD4QmmCYwI3L/bPw4nplgPKaG/e\nxDAu5GCSiIUBwR4LNAAFfCmx88VhQqq1cUh9uibHDLmtwWPOroNL4JcuNddA\nV/tR17cj+CnHicV935OxhtaRJ0016jPJuEGlATE+1uAHlD7GcLU5+oXapkwQ\nb2m9yBYJlT0QDRqWdQpP2Iilrv+y4T5xucpfHxQNcmiCI7sBCQe3l+Ro73TV\nHyhvyT8fN/HflfA0wdseS/mRxRAgz1lMAeyhWA/0vO4vnsF7RVCBAG+Af4bR\nfkcomj/nvFm4CeLl+zRjLwkBdvC072gCEtD43bs8OX2dU/qsZ9PnGYm9kwhD\nnaQ9DNOVj3xAAYyNWjJ3S5+Qhs/DgsBh1btNPNjRjntjnBp9+z2uuxCAFDi8\n1Py03adTeDX4G6KTRgKg5/jj3dM4I9aVa+35CmtADerGC22/9EN3pZzS719s\ndOWCkisV/mGgcoLfky1jVD+BbAwhKs2FVCI5BIuJ11adRgjsxHOa9T8/q1nE\nkKocSwrZk0aty067WzJNAUCor6agKP5aciUGezDQquCNOkI5+lfWJGXwj6hu\n4MR8\r\n=qAgZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDxT1yqxV3jrX2hvRQTO8AQu9RETtDXWztvGqDUagUDggIgZm7JiFUvsp48Z+nDxvwst7jgBKmA1Xxd1/ARwSkF9KA="}],"size":82522,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.1.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.1.0_1579132502458_0.49819500441948805"},"_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":1579132502694,"_cnpm_publish_time":1579132502694,"dist-tags":{"latest":"2.2.2"}}