{"name":"hypercore-crypto","version":"3.3.0","description":"The crypto primitives used in hypercore, extracted into a separate module","main":"index.js","dependencies":{"b4a":"^1.1.0","compact-encoding":"^2.5.1","sodium-universal":"^3.0.0"},"devDependencies":{"brittle":"^1.6.0","standard":"^14.3.3"},"scripts":{"test":"standard && brittle test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/hypercore-crypto.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/hypercore-crypto/issues"},"homepage":"https://github.com/mafintosh/hypercore-crypto","gitHead":"4d74ceb5bc00b59b9180bfa6ff16e3ffc9d50c61","_id":"hypercore-crypto@3.3.0","_nodeVersion":"16.15.0","_npmVersion":"8.5.5","dist":{"integrity":"sha512-zAWbDqG7kWwS6rCxxTUeB/OeFAz3PoOmouKaoMubtDJYJsLHqXtA3wE2mLsw+E2+iYyom5zrFyBTFVYxmgwW6g==","shasum":"03ab5b44608a563e131f629f671c6f90a83c52e6","tarball":"http://registry-npm.ywwl.com/hypercore-crypto/download/hypercore-crypto-3.3.0.tgz","fileCount":6,"unpackedSize":9866,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4LRjG5ToP18UJEB97MT0gsIT/Q/CIJospsaQmm52htAIhAKXEr/QW44jXo/e8HU/YrFsmcIIjVrZAazbvTY5d6fGM"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJipjZTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3VQ//SWcWrOE6dONrZtZEFHSs/4et6RoYz6ECawuAWuZYeGdMjxSe\r\nCGVj3S2MYV5KuEHtjRc4lNifkfYNZ7NDs94bQzAYnQWl8nYcMIvcvZW+eR4q\r\n2rmMSiS8440dvIbI2D7TbmfR3flJ+W0FJxH19dOBvSzczKVNJCDIKXgrzyXr\r\nvnuyesuwEUbPjtxe/CYcCJ5UyKbDTopaoMlbSScYEwO2twfLEArJA0ayh2ci\r\nUZEqsakJjj2KfLlbDtK9stuxq9rgZ8BHP5Nyuzty3gmr8kE7cH8RD77xNQ4g\r\nDBdB4gp/Bzt4KPFhBsaw+cp8oKTY8HGwOlK86DgxqcGQj67GhfHzHr7X6T/P\r\nEIvA66oEx/s12Hj0XkI4WORtxdLKFTGLGGbbKY2xdfiIZNnhFJ6ZoImXtdzT\r\nIfEZauhXEcq8tS7IHpyr67YQZF7i0GsfWPc+FL+oSuepC/A6fpcwbMzBnFNB\r\niehIwB2f2G70fo5aEaSIH8risPhxCyjXZaRLJPezINA3rtlHiZe9bZ7f/yJ2\r\nATWbbp3Sn330sbLIk96Fgp3G+sh8fhI8saUhsXK2Iue+/NB1ICKflCtQpam4\r\nOWwudeXTIej7JMD2OaF+PNVWTcz7Mo9V7yNLJFych9MagifkUfxAxHP7wQiY\r\ngFb6g8zywYsJEXKLNU1niTeLck5cNi7P2sI=\r\n=+POk\r\n-----END PGP SIGNATURE-----\r\n","size":3830,"noattachment":false,"key":"/hypercore-crypto/-/hypercore-crypto-3.3.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"andrewosh","email":"andrewosh@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypercore-crypto_3.3.0_1655060051142_0.8861796026488313"},"_hasShrinkwrap":false,"readme":"# hypercore-crypto\n\n> :warning: Hypercore 9 uses v2 of this module while Hypercore 10 uses v3.\n\nThe crypto primitives used in hypercore, extracted into a separate module\n\n```\nnpm install hypercore-crypto\n```\n\n## Usage\n\n``` js\nconst crypto = require('hypercore-crypto')\n\nconst keyPair = crypto.keyPair()\nconsole.log(keyPair) // prints a ed25519 keypair\n```\n\n## API\n\n#### `keyPair = crypto.keyPair()`\n\nReturns an `ED25519` keypair that can used for tree signing.\n\n#### `signature = crypto.sign(message, secretKey)`\n\nSigns a message (buffer).\n\n#### `verified = crypto.verify(message, signature, publicKey)`\n\nVerifies a signature for a message.\n\n#### `hash = crypto.data(data)`\n\nHashes a leaf node in a merkle tree.\n\n#### `hash = crypto.parent(left, right)`\n\nHash a parent node in a merkle tree. `left` and `right` should look like this:\n\n```js\n{\n  index: treeIndex,\n  hash: hashOfThisNode,\n  size: byteSizeOfThisTree\n}\n```\n\n#### `hash = crypto.tree(peaks)`\n\nHashes the merkle root of the tree. `peaks` should be an array of the peaks of the tree and should look like above.\n\n#### `buffer = crypto.randomBytes(size)`\n\nReturns a buffer containing random bytes of size `size`.\n\n#### `hash = crypto.discoveryKey(publicKey)`\n\nReturn a hash derived from a `publicKey` that can used for discovery\nwithout disclosing the public key.\n\n#### `list = crypto.namespace(name, count)`\n\nMake a list of namespaces from a specific publicly known name.\nUse this to namespace capabilities or hashes / signatures across algorithms.\n\n## License\n\nMIT\n","publish_time":1655060051331,"_cnpm_publish_time":1655060051331,"dist-tags":{"latest":"3.7.0"}}