{"name":"sha256-wasm","version":"1.3.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","sodium-native":"^2.4.6","tape":"^4.13.0"},"gitHead":"de73271b45b50846d3a2ef6ac6d201ac5907164b","_id":"sha256-wasm@1.3.0","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/bPoRjEXqbSpsA9MDdjy3J3GWQWiZG+tjJbWYqhK+Ap4JWNJBxqSMJnIIzkZOA89UFqQMdKSoioNKXqXAkDyWQ==","shasum":"5cdb7d54a9833840277c1cf1e30876e6819ded91","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.3.0.tgz","fileCount":9,"unpackedSize":1088293,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6zVECRA9TVsSAnZWagAAagMP/2k5pQuFPxPKQ+qwM+u5\nmDtBJDjMd7TMt9+C6B+07dbyFnne9jfNNpFwmQ1hjkXzV7grCIGz6HDupfu6\nGnux7/sKuOHPkdVj3WUB811+DEA1KTdHQGF7z45X0aCohi+l/4GuoRoFdURg\nPbo87B8Ie7xQ2oaW5BawbdYcroPx1tUqCkuDML9F6/NusqcK9vrX/Tbl16Y+\n+ohvziv+FycDZZF8Fg+bW5UHNxxi7euX0Rdph3IA32nw3uz9CI1EkTTGlWVL\nrqH320ZWkCJehi7VTtT9tlZPfe94lE4I92wDZ1kwR02VJa9puGuLHE5v/sBL\n3NhtYuifvMKrtsrX80TPAJ9cuwSBZUwEDSEgicT6zySlIgVJl1PYry9LZ85w\nF9NTkklv7BdNQO6FqAlFVvxXOf+BQqokevtnSa+R+EqBqIWxnvEMk3H+h2wT\n2KvkpdSSYC4qxFAfRQ3zZKVW959qrV2aldaJ1KlePAYjTeuJ81ZRWnNQemsv\nvY6H5peRdOw041n2fmylR2u0fcSYY5enYEXSf5XX+DA7rHvkVCcdPopLj0Kt\nPi6EXS05xMEVgH11a/HR7IQ5Y4c1ULXjxmH1GeOp4lqdD7UbDA5Tegs3kCYW\nS9YOAOnq4YYR91qjDMntm0hM1IQL5WVyVs6wQ31WqwZc9gJmyQ7ofqFitQ7i\n1yzg\r\n=r0Eq\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEMCID/Ug7zJdpAnb6IscDN3qdB5EdoxIe1fKCWnwR6AAkT0Ah9ZEM6eOWnvArFf4wg4LIj1zHTMLZ4snIJSGhnvvHoo"}],"size":84562,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.3.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.3.0_1592472899672_0.9072956317919252"},"_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":1592472899816,"_cnpm_publish_time":1592472899816,"dist-tags":{"latest":"2.2.2"}}