{"name":"hypercore-crypto","version":"3.3.1","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":"^4.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":"e19e72b73dd4e059ff31cba0fe038c74a0e0cd27","_id":"hypercore-crypto@3.3.1","_nodeVersion":"16.17.0","_npmVersion":"8.15.0","dist":{"integrity":"sha512-Fo0ZBMDW3P7HFh58AQdxsVop0Xh0Bper4Pyl5Dpc+tvGos6je2ufJpeepaHaI0mNkKq4we1ikd47kTnx2XJd/w==","shasum":"3bb2290045e9d44ee1bf5286158a3fad16d2406e","tarball":"http://registry-npm.ywwl.com/hypercore-crypto/download/hypercore-crypto-3.3.1.tgz","fileCount":6,"unpackedSize":9866,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdgA783U0fA7A3k7XjLVcn4Ci6IAlYm+H86DrA5gaStQIgPNw4dqdiubwR3Laa6/c1GG5hoKYMtlVZhPv1rXGauzk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvT65ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqFfxAAjo7HsfxKghTYqjTrxVnK3fso6XtNfNQeAVgIoW8ktuSOBr0i\r\nYi3CgO2ws/ULfuyoPuGvPn2lu8nYpiFOXsyNdlpbvNadhdUvJmtFTfRviHjJ\r\nY1vEP8jqHjyM+CoC2yGTDVh6up4jlXgE4rAjvcDCmoT2jruBbi1QheIKKOKT\r\nfpvX2jMvmlKsSHCp6mfadDXJcg1xEnQH+gtTRZRGaiB1I1BnviaeRX//cc5Q\r\neitEAE6fwCbGcSLBqhDoXT6az0oUPe7AWuDk36+EyeXRN1/oDcKZWZv10Jkv\r\nL2BpPq6h/vRDDLjSlcEjPvR32WcCO64z2xgJY7XLfKc096bvaZ1WWNArX7hY\r\n6dK90PtJchqL4L5Bub1wIoCNMDvzOYjXxp/asfbJ/12QRyN7gjgdQD2ZtglY\r\nL/zsDRb9yis8/ztqM/rJc29GRQ2fsCiYTcclQTHVKtmUOzlWbRvQBaOGag3Y\r\ndYSPnRR86mquJlaGXsEhyijxEGStUiujqaFfWkT36DdF1+PWCVZo55+6NVV+\r\nT8DOGpeclJ30Th9CBOB2mkDdMia25C9M7EvQSyWl3Y7PejOCdZJ0jGKBvFSx\r\ngMbFNT4FgpHs0ufQE0S2wttPDC0zNdIf+l8T8UEJI/csY6Q/X5Gp0TGVaH/W\r\ny5bPWdTtHCWmoYrgtQY8kCijll7o5XdN7Nk=\r\n=yk7N\r\n-----END PGP SIGNATURE-----\r\n","size":3834,"noattachment":false,"key":"/hypercore-crypto/-/hypercore-crypto-3.3.1.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.1_1673346745044_0.871546173212769"},"_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":1673346745197,"_cnpm_publish_time":1673346745197,"dist-tags":{"latest":"3.7.0"}}