{"name":"hypercore-crypto","version":"3.2.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":"^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":"184f7ffb8ce5a88a553c199b6e87e2e8cc7186e3","_id":"hypercore-crypto@3.2.1","_nodeVersion":"16.13.2","_npmVersion":"6.14.16","dist":{"integrity":"sha512-Q/LhmXjNM2eLAAA41pFQzpb74bwFptNCz/KC5KXJXsnfpZmrpZkTTYHSvm5zy6p5UwLKQWOf4V0KenT9q3HJpw==","shasum":"98dcbf5fa95ee72b114165c45a9db0f81ecd19a4","tarball":"http://registry-npm.ywwl.com/hypercore-crypto/download/hypercore-crypto-3.2.1.tgz","fileCount":6,"unpackedSize":8945,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiK9BJACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHew/9F5ptY7i/lssayHha+D8NvTioBuoTmxiNx5CZoOSzwV9zVg24\r\nHK79zAal6Wyg6NmPN7qCc0pxhr2vZoFnQ7qScIJ4j4NICeV7benQpvX+95Je\r\n7ZXtyL0XvT4xYbWOGr7upi5pia8i2P+n/Zr9pSxnV5T64toQc4CZBkjuM3Ih\r\noMI4BmpJeKen809w7z3aGVHOzDRHkxwdXcBt0U96Of94IDByzLRx1ez1ZZ6t\r\nO+y2S5cfZslnyrHEqQztFGX7bkzgeoxodUARz8e4y/QFl3RyTmpx12rMizJH\r\ngCw+VUkhJUhtM/abqi3C9kxA1FAW8W7K8ccdAiWbe0aq/tLRG6Sl+jaYKDJV\r\nantYw+sawnqqnBUsuEK3Rk4Zi0q50N7X4TIJ/IJ+DVI35vBPuETUC65et33k\r\nNE2wM14Fld5to81izSwgo5ppmPvpGCZ6k/XkXjx6VWOJ2KSJvBJJe/5Injw9\r\nLm85PPsjBC2TPg5iGhUrnTYRLIE7K2T9YDMymcEECEKszZUcozbzIFBSrE64\r\nqC/AbCPeSmyMRZ6C+aSyyY28tn9pr3YE9SXntED59zBqmrMoqS+i/1WZCo92\r\nHynW07UNqVGdqgTF/IhaWLsj7vYkSw+rjLo/L22UeIN2fBfSM3ldG3hdNYQR\r\nErMTjkwIrbUv/4Bhaxlu+MsbolB6Jvs6VW0=\r\n=A3Aw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG4FRT39TF06azuSAzP691SzGQ88wlcOuGZeEAOF/9kUAiEAutRYqTpwPOS7NgSR0F26d/c5tYJqitMS2w7t5xxWIVk="}],"size":3623,"noattachment":false,"key":"/hypercore-crypto/-/hypercore-crypto-3.2.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.2.1_1647038537093_0.5650651901697188"},"_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":1647038537265,"_cnpm_publish_time":1647038537265,"dist-tags":{"latest":"3.7.0"}}