{"name":"sha256-wasm","version":"1.2.0","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":"cd38f63c9b5eaf58aa83c52c63ce9eb988c9941b","_id":"sha256-wasm@1.2.0","_nodeVersion":"13.6.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-+fqiHKJ58m2jRaKTAPH1aSuf7YiyzjLhMA2KF+gRC+N+TcsDNe6C7TW49jixY0pEKsvV+VKprbEWe/m5CXXeNw==","shasum":"ee9e34e17d4caaaa2b6036448daa5fe63a537ab8","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.2.0.tgz","fileCount":7,"unpackedSize":1058206,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeH6onCRA9TVsSAnZWagAAKhcP/0jrX01yUALYD7coAujC\nlhTE8SVWfaqxT+B3kSEV41pIBRZwslQruRUSRMdwDayg9IdK6NLny9d7YCR2\nVGlED6SjxRmpUv5RudqM3vcbyhvHTR5tIMTUdiIkG8CHaaDwmigxo3vFFi2S\nSfBTWhH0bsCUpzcEMCk3dd/VsFyFRK2SbmNr3latcyALbqq4362+BeV3dNUK\nwMQekcYyrUfZumtpdpJAOnQZNG6g8YPsEvc1NxtpCUry/wHK7Nk4mBoQc5dx\nSb3LZ3ow+IWSMsc21VPkl5EHeeyXC+wGn6S6fF8KvbMPZQEi5LMDx3+g+IOC\nUNkCANyuaSp4TydSqp2w8QLmnGcDF026bTvFnRAF3jF5xQfRWDgGFiws3URg\nHtkS6XwPW1L2pJaWwFjusRJa7j9Ewl06t5ynJOSt7RB0JnIgQKyE9qP4g4ZO\n46yCprokKWtRFMHCWj/lNPZeofgdyzzCEarmDAX4yKHuYVqPTCp3eOSv8RZ8\nCyz1bXSHnlVEEV8l9pNYMDirCXxPWV4jll3+xWTSksqka8A/Hwfk33lsa0SY\na2kYWln9iIFywktwak/Zl29h7t3EPlaJtXZwOrJ557XgalFtNz7x6TWpcOc/\nCzs6AHB0eDCwZagzaMFMMrrO+TNdA7ODTyxW41UHphzg96NqSUAYMYOIp/uK\nXRmF\r\n=DlU1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGhNx7f4VvZmUlqFhIJnKL6dNg6FV1uoP8vlxqInZL05AiEAmf9FQRt/cpIq+cunHqmFVswcGujlmOkpqKcPHUZSk6Y="}],"size":82320,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.2.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.2.0_1579133479416_0.16217391482768906"},"_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":1579133479544,"_cnpm_publish_time":1579133479544,"dist-tags":{"latest":"2.2.2"}}