{"name":"sha256-wasm","version":"2.0.2","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","sha-test":"^1.0.0","tape":"^4.13.0","wat2js":"^2.1.1","wat2wasm":"^3.0.0"},"gitHead":"12daa87697f2e4b74466decd7c773ae4e26f9541","_id":"sha256-wasm@2.0.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-mxvzVUx53apEurj/iBZzxihBtaflghulijYtRlgOpHzZu97k+8kUeBkE8Ry+IBQqhtGbk/FBBqIJs6lOnMm4XQ==","shasum":"2338fe8b0cb1efa36eaac20a939e2352db1de794","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-2.0.2.tgz","fileCount":7,"unpackedSize":51476,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/e19CRA9TVsSAnZWagAA6/sP/AmD9DoX2Q2y3j/LAiVQ\nH85nfzipg8zf3ugY6P0ITPufxU/L0iVMfPa5vLP5F7Fh59zwN6U+Z32yBoCw\nEBrsaTLb37WLq95pqGVJTu/RY98AwEYW0zWxf0NR8+SPYUaz42XIm8KGG6/6\nQIQi7mB2flth4YkI9SFPrYOQ/cRRgRZQocw0zPkrnONKAtOeGdAjbNq23H6/\nNAQVO8y2Qk4+cdpgMKjikxTRCoGFsf1BdTg5QutJxJgzbatpp3DNjp1RwWyF\nx5/p6V+vFNhIP+Kv1jpUfqaoUMeV33hatWGwSu7PMlKRZQ/9JVlyna5N+EK/\n/cFmAmn3ChEy9WqQQ+b8vsN7gJgQdQ59bRkAbZw92HkiI7OWJcGWCR9Tq73X\ntXBKIGtMYJhN/JqPdaKpG/KhqrgfV78TMeHVRbjxiJsz7bUUWvyn0t6rzVsw\napTegCHEkARZe8dj6BvSPiVqW+GwgSIoWMSUQPUnJxoD1p4FH4C6PaTOd7e5\n8pkuOi/YY6e19ot33DhWqIwYTHbhCsxI4Sqm8NmcAVH003CXAnCwyByjLdBB\nXmCMtlmOyIXf38ho7gS1sp5YWUrOBFHDBgRcxrMUfjFJCIKfQA+WrNetu3QZ\nUAfYtI0ezxOX3JZtrSV5NU+zlh2ERiwOAKsZZgco1eoCewOfiO21lSzP/r2C\nPm3l\r\n=8QgN\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2CDuCjgfGqLzeX0UCYcKbcanEUg9Aw0UR8Qcug1EROQIhAOnE/esh6SvDNGpmHfaAWhVlXYjGVzTCNWtmVE7hMAvj"}],"size":10957,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-2.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_2.0.2_1593699709329_0.5122111296609693"},"_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":1593699709458,"_cnpm_publish_time":1593699709458,"dist-tags":{"latest":"2.2.2"}}