{"name":"sha256-wasm","version":"1.0.2","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":"d774e4167d6318dae511a84eb2fb9620313d3fee","_id":"sha256-wasm@1.0.2","_nodeVersion":"13.6.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-LcefL1nWIHIFw4uyBxOq4LoYcmeqn9UMaZx+oP5fWUR1Mj49vXfAplDNBFzktBEyKlkf2uUHvaRQ/udqErbF9Q==","shasum":"ebbc58072d2a1403bd8cc5617f055a134c3d97fb","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.0.2.tgz","fileCount":13,"unpackedSize":1048863,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHdaKCRA9TVsSAnZWagAADUEP/A2hSjTNx5WziLLXkGHD\n4ynP8z5wRhWwNhrIgbs9miXkhtKmXOGDviba/YFxgVBsDOygJvWw5Zih3RL3\nZPVWiPO4UJJIQaSvS6Ei9J+0+jCTCWgZQaS+P7TuoCnm5R/wahm0p2IiNlEL\nCV1IhydtyIGbZtB32q0nuLvi/oDnp29w/rb8hpz1AetSktUwWWUnYBO9074W\nVq1zshcQxhp4kyKTmXiNBxE1K2oAeIyzgRulK262I1KSDDHJf/NJk6JiVE5P\nDoyCeQdMQ4LBlmzKD7rZAYP6v1LNmGnSfhH71JT/1zqa5Apeur8plPgGxJkf\nCM4Hh64xw+XBsSG8rEO3L3f+msljCdVj6y9feqGB+9klNp6ViFBKmfM77Ab2\nn4V2/fN/LYpSsO5DZah2aM0clNlUiW7iBWvjEen3BD6J/KYOenMFqlqgA9fx\nhIb/9+OjG0A6wZqpkgwfelfTF7mvhN1YeqMGXtTKCwY2olxlaKMMVfasUX5g\n7ffidM/m7DX0eKC6n7CjkbrD8cMslcGyY2j9jP1ZvzIafEjrPCvodgBOTtwg\nKkWsiHearwbGhZCwe2YbnL2Vjs+2szTKoFDPdS5xmPItZ8NJJV/ZHaKNezoC\neUXUNqitC2gWu4ia/Xeg/xTCehli0IiHPXBbKkaycJZJB1/ym+m8eziqa6Gb\no9PW\r\n=ZZvc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDEDakKMZ6Aft/pPI6796bxnxQBe/NDVkYk6pYbOlIVJwIhAI8T/pFYZ+AAV0mCYOymEv2MeraTLosxsf3SyRdsjsx1"}],"size":244526,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.0.2.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.2_1579013769509_0.4002281015131999"},"_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":1579013770035,"_cnpm_publish_time":1579013770035,"dist-tags":{"latest":"2.2.2"}}