{"name":"sha256-wasm","version":"2.0.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","tape":"^4.13.0","wat2js":"^2.1.1","wat2wasm":"^3.0.0"},"gitHead":"b63937965b72568696344464fe3c0815850448de","_id":"sha256-wasm@2.0.0","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-V2nklvcX7ShB+pjzDRSY4JemTv/EHS/E55BLRgQJkxMOFbDWbzBBupHeB4WCQ39z2pmd6QLGNrJXLKEelxMcsQ==","shasum":"c9df7ee8bc9a1c64a0b1f832ca89af063aabc275","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-2.0.0.tgz","fileCount":8,"unpackedSize":476268,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe/dn3CRA9TVsSAnZWagAAFlQP/1JFCsbX3NY60EVdC5LK\noxl5wYV1MU+Nhv5EQIgfVXR22Pa5RPX571MGWWI9ZAT8Sla/k7JGjq1kcs1b\nbpvUtiRtI4qgC50mpTsxjhJRaQQDW95CZiWCORCg/2XWaXEfPAV/vHy/3nFR\nw4WuwvsJfe+NmRUWBmpxvC3+eWnBxxUa4cT++50HDVf05RZDcP7gwyHbMyai\noqH0exH4gLUR3rwhNQiv2maJvOx2lN0OFNWlKDn6yMpNTpFqTPdvlHMtJJUE\n4AAmxAVD+fIbjH2CV9SlgIsqU2F+CKjyDv14IvQEPyx0Pk1szHRLQWkMggUo\nGhX/+Rv0gcoO4QZ05xGsGrS2KaP6CUFKThTEtiwC3cGMI9gkPD9/UYcGgSwy\n3RmMfF8DMfDGaW0dlnOoOWWTauALhkMiR2plLfXO3PfLOI26BVxZH5G2OW5p\nACnE0TszZVJRxEXVk0nUXOGwuCcAnYEhjDhZBExLaBLb+54nowcuMUptSG+3\nZ6STbL4B9j8QP+wi6PxUEfFK9LvY99ZtiCE5N9Bv1e8O6yw84VOcI6kmw/+M\nmttuEEU7qILpmO19Cq1wbBnUeTVWbXceFNyfgXwKLEf6hje7Oqz6FzMqkdx8\nioVe06NSxzJq7fmUXGvpH5qMHzdCEoXKW36VlabHZEu0BmNUccWmfMARqFaL\nvHIU\r\n=V8/v\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHghvNDkfSsoMH+JLFkHAFNY76cvujLmob0PZ5mLTuaZAiEAiq/n0Ad3DgbxXsc0ZHSjZu1Eu3psqlQdqNQ3SxCZ8Rg="}],"size":66864,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-2.0.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_2.0.0_1593694711140_0.8334714627557887"},"_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":1593694711333,"_cnpm_publish_time":1593694711333,"dist-tags":{"latest":"2.2.2"}}