{"name":"hypercore-crypto","version":"0.0.0","description":"The crypto primitives used in hypercore, extracted into a separate module","main":"index.js","dependencies":{"buffer-alloc-unsafe":"^1.1.0","buffer-from":"^1.1.0","sodium-universal":"^2.0.0","uint64be":"^2.0.2"},"devDependencies":{"standard":"^11.0.1","tape":"^4.9.1"},"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":"ffc8f339bac0060e1eadd273ba8bcbfab33d27c8","_id":"hypercore-crypto@0.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-38QCbdW/Qa8Ciqc7YRyJVYldRKpbeLhkxK8lKbVmVK9uhTNRRNII/ifNNTWL6vV99kT+WNhuCXB8PLD/sK+a2A==","shasum":"c997747b41e854b126a16207c52f3de4c28f11c8","tarball":"http://registry-npm.ywwl.com/hypercore-crypto/download/hypercore-crypto-0.0.0.tgz","fileCount":4,"unpackedSize":4338,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbM/lzCRA9TVsSAnZWagAAR44P/A5kcmnTrE6babh8LDSD\nyEARIx1M7iiYj1TDFLLflP2QcWhULCR0jOdewpHKszBbOfJ6qJ9TX2TKcIyN\nE4k0N8vZP6ajGbZyettqRIB9Zk1ei9xBrfM06zK0RoY9f7lFAQ7bsw/C/P7N\ngRdOy5Qny11aDa0yUOeiJ0uT2gTXHSTdxuftb/PV+tjDI3t7vR1XXYOVY86Q\nxr5tIBgYn/pPnaskXOpf9wG3bqUSuNhSP7IRLYD1smpe6p8ZgpKsosR63Ad3\niz3PA8en2WGlE4+72ufvPWiPo+ncMxLiZmtIjZs5EWMgFQgdhEQO4X4jYREA\n9/YJ8ha8JINKkp2rK98vGULVnW3qjnIPRyTZYPCE0JFNffbaNpYCTn57k650\nmqGLX5oVopX6IWN3rNI/ajl8xM3w7b1jDyFQ3996Jvs4Gwz4uWDKelVE7PC8\n4LQ+PdfVE30taAA6IhYuoRdRahnnSrbYbVC98d7B/yPoc50CrBKc3juhehv5\ni8rSnhBYk3HNe0byD8uXqSlu/4WrHsKgJZ/mCL1VTHMkXjABfj4o1Ua9uW+N\n6hj9MITC1Gk+20T+1ZcegRkulrqLbRVZx3KZpJtj6luoCRK4YINvIOk8+Ss4\ntlqNAE+DGu4r7vZuWCkVAkhksIGCt40+1a76Lqx2PLe4RurY8bxR5uE9DDBB\nJEiW\r\n=g+gw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC+q+Fvztl1MK7loSV7Ib6tFY+bnyEv7yDBwhIAwDAv0AiEA8aQg3m/nWsL6qxYZipVPZvGd6Dbr5sUro/hCGb47aMQ="}],"size":1993,"noattachment":false,"key":"/hypercore-crypto/-/hypercore-crypto-0.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypercore-crypto_0.0.0_1530132850914_0.5001094131888266"},"_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":1530132851486,"_cnpm_publish_time":1530132851486,"dist-tags":{"latest":"3.7.0"}}