{"name":"hypercore-crypto","version":"2.0.0","description":"The crypto primitives used in hypercore, extracted into a separate module","main":"index.js","dependencies":{"sodium-javascript":"^0.5.6","sodium-native":"^3.1.1","uint64be":"^3.0.0"},"devDependencies":{"standard":"^14.3.3","tape":"^5.0.0"},"browser":{"./sodium":"sodium-javascript"},"scripts":{"test":"standard && tape 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":"2c43ea9b25f3b620de3541f24e61e26db700874d","_id":"hypercore-crypto@2.0.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.4","dist":{"integrity":"sha512-LFbX5eaMfcfoffn0MrgXrZgHz6T4EslWnB8l8t2YNr1ofmAtGwmsKf8OXcwVcguepfaBt1521LFvuGOJ51wPzQ==","shasum":"0b96d3bd1afa3b518e79bfff766f6de9c8fa50f6","tarball":"http://registry-npm.ywwl.com/hypercore-crypto/download/hypercore-crypto-2.0.0.tgz","fileCount":6,"unpackedSize":8766,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJeu9avCRA9TVsSAnZWagAA46MP/2IAguLagxL/LGW7QjRG\nKbezjAkL8wzPGLwldYbE8u6+u64sWy7+e4CIXFWx8CXuPWjVFZNgL9RpjwQD\nsr9N6ztNkXdIgR+NRFmQRp+SQYHumvXO5BUiUlZnrfzs3KAb5xXDaiJgtSh0\nskTmrPbXhGlD5LxQa+WXNI/lazl/gPolybLQ++b3k9Ob61mAIFkGZxuJJAoq\nO6dSsGL3xY1kCW5aZnvzvi8LQ/oiIXVTW7JK9jpqypcM/a4oNsgCsYT2ZTlL\nHxw665pxEXPRz0Oo10J90SpyFCzNQl7gs1VL2CFl4VWx7WPOxt8yhlleSMfe\n9ivLQ0DEVtbaiEHI7UnrVU5uvAgjAlzn+6Ol2hSoI0ZLKdqWwVwZC3Sl80Yz\n4yF9zhiOAmquZ3tvS6xNiZI7JtyeaXKAnuszQrwQW1aH3GdevlR3YvBFecUM\nzJujjBOGKI6JZSLFwoo2saXYb1PlBIVQmiD7/Wx78DBkA15zFbkUWUKEm4bX\nuPa3V1urQiISLl0mbMPn7V+UuzYsqfvk917e9SgahtyXrPcYYQWgYM903NEY\nAhEH788cpS5jFDSnMJGQqDlLT5QnZWeopRFsjNjsN4+NppJh3qs9WYkaU9Bu\nZ3A3m5lKIxtsxxaKSgr4DZD+dtoLY4IMrxpAKhW/5KxOEjhyCttRuyyaz/dS\n8Yx/\r\n=fhIl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHG78dCYuzqOV2Wn3TeEs2z8/vxSepJHYU8lDqSvJFkAiAZ+SMP+AWv9n5THyBFwgUaqFvdeZBPkOG+EQ6q7AVOfA=="}],"size":3252,"noattachment":false,"key":"/hypercore-crypto/-/hypercore-crypto-2.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypercore-crypto_2.0.0_1589368494008_0.44043212979773116"},"_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":1589368494464,"_cnpm_publish_time":1589368494464,"dist-tags":{"latest":"3.7.0"}}