{"name":"sha256-wasm","version":"1.0.3","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":"6b079457843d81f6cbe81c92b89ca9e1e903f9d2","_id":"sha256-wasm@1.0.3","_nodeVersion":"13.6.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-35kKM3pdG+MF8SLIkbAqyJArk0xpOVBTwp8hyJhyRxvttDtvNaaL+YjOIbUY1ainvVL87aLdaFNz0P+aZ/7h+A==","shasum":"cd2810d2d3e85aa66b73d265172043c8ffd77f88","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.0.3.tgz","fileCount":6,"unpackedSize":636587,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHdcXCRA9TVsSAnZWagAAOoQP/ipj7X+6J/lt4muhYB8L\nmE7UCOLwWbB3kFqZSRuu9dOhtH5pHI1T7OElzO3ZLR/gLHiIyZpT4HZiOI/a\njgX32IkXjb1uKGUanMO5YEeENlVYO2/T3alh75u2zNO1NfKPbJLBlIGZ7p8J\ngMgZBXFsF6qaJAOPxPxT0Vgb5C+niHE5nE+2AE2gzk1RlNfmnYK9Yndz5qDe\nzlMCSsceWm6rLCgur5/ZZQGR2SSB+iuVXE8wfJq7LA16exgzKybe0LQJb4Ki\nzTjjHkDMcjvP/Q+YyHofsFQpgIX5XArEGuh4ukhK0O8KuYXJZrxw7yBa67Ak\nqrGAHHQkEQecxJQ8Pt0/YtkB2VOycc3YkpW+PBkhluvdrS0yQ+q2O9q4KhSq\n5slRs3RRgUY+zUDN7XzylswvSuQJSTHqRN7VgZlkAWpAPANhiXeAGcGXJzTF\nyHCGbFLMvV91w78ahCBdYVCpiOtYoFeTqAGo+ep7WK5O773L/AavcFTMELaw\nyWTF2IkRb82zZ2Ca1NCjIIoiKo36r3XS9qDGWR6Xk4dqZX/YzRmyFjCHS6LV\nCMhR1iCzBGHv6suBmbH9v0BpglLLrk5H4AENcMg7Bg86x3biHiRk5yrhcUeU\nrS6j//5GzVd9U3wco+1Ii75GOg7gWQ+veG/WhXIsNgs0m2priCSZBlj++IY0\nJjeZ\r\n=ni7d\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA0oHccfAf1bCFHbxI1TSFEfy/xiVIuPiBKEwB869ut/AiEAxUeS0fNxjB7oNGAmTL/4liELLHYqL/bULSRJDsTZtVY="}],"size":27755,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.0.3.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.3_1579013911401_0.024852725479322935"},"_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":1579013911590,"_cnpm_publish_time":1579013911590,"dist-tags":{"latest":"2.2.2"}}