{"name":"sha256-wasm","version":"1.0.1","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":"f740531bb3281bca658df30277c02197f842b7f9","_id":"sha256-wasm@1.0.1","_nodeVersion":"13.6.0","_npmVersion":"6.13.6","dist":{"integrity":"sha512-sMxT+jw+waGSZK7+X5ebtq6oCsAcbhgrLRkZenxdADoziPLxbQWkbXttlNXJRLmNXMe0PgR5B/nGIgnD6vI5sQ==","shasum":"ae2d5a340163c2531e0f39ed50351d746ea1431b","tarball":"http://registry-npm.ywwl.com/sha256-wasm/download/sha256-wasm-1.0.1.tgz","fileCount":7,"unpackedSize":639456,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeHdXXCRA9TVsSAnZWagAAFdwP/RpAX3po4uLnKQ87Lxnl\n9PzPW5wLodyoRjiGJcsi0QXhg0CqE9XFE0y4PhbPZvg1jeNxkt7p97zrQBYT\nxpHox/MsMLvJ5wzWQarnlXxGifiPCqPS/CtY/56z8yK1mfNp1SxMcubJX4P3\n6JIBhaeeWSiO+MJr5DTE5ecLgvz43htV3UPWSi3HjWiLoNnb5dAancsllNoL\nbACrEAFF03RwBX3FxS8vsLDdOYHh1go38rvx7oiplzKy2xVtoqp+V1pGoK/G\neQ5YGYkjS/k2RbY2284p4ZRfZqCQNKnbm9k0eZL3ygzeEDUUsX6AR62Yok59\nBudePA9knXhznoeDnsrc8aOWqxN4/Mvh573KW7rwzRYJCx83IywiMlyQpnUo\nW8HceUj7smfo8jM04HwcqlJlx/r+nCdDQ5r0NOHSjMllXZll8OZu9As7RPaX\n65EgkXszwXDJXj6LYSAm1yNM5HKnXYSrJCvroBa2YxWxFYyzj2hY8i5mwA4x\nWEMxXW/lZMMYR3e0/0NPDAlT9LGuAsFMcnAhIfs0tOIWS2wC8HteEn/UXp7Q\nfe2unXSrnXoa341XPRu/km22NWXRutI5A1fXpA4+/lJruVUBkLSRPqZ/Za+H\nTYG1jhr1X62NdfGnhgRlQHzs8kpDKBNsZ3R9GmpIqEHDRkcasniyEkKRvXZl\npwbO\r\n=bPZr\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICOGNiiUwDFRS2cXRHeD58GWfKCzzDBcqhPGRX8k/6ORAiEAspAPK2F3rBVra8vqJfJX8rVwQYksiMJa5494v5g7FRY="}],"size":29851,"noattachment":false,"key":"/sha256-wasm/-/sha256-wasm-1.0.1.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.1_1579013590850_0.5544998569949611"},"_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":1579013591004,"_cnpm_publish_time":1579013591004,"dist-tags":{"latest":"2.2.2"}}