{"name":"hypercore-crypto","version":"1.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"},"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":"09b09cfc80f6e0aa51e1dee1bab6e948ca5c6a60","_id":"hypercore-crypto@1.0.0","_npmVersion":"6.1.0","_nodeVersion":"10.3.0","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"integrity":"sha512-xFwOnNlOt8L+SovC7dTNchKaNYJb5l8rKZZwpWQnCme1r7CU4Hlhp1RDqPES6b0OpS7DkTo9iU0GltQGkpsjMw==","shasum":"90dfd2c77364483d24af204b9a99136cb6320de6","tarball":"http://registry-npm.ywwl.com/hypercore-crypto/download/hypercore-crypto-1.0.0.tgz","fileCount":5,"unpackedSize":6624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJbNOyhCRA9TVsSAnZWagAA2qgP/Rhu0tJdeRtXl43udV5L\nXIpfcKRRUq/qJc4ixshJQRvXkv3W7ni6+B5C/ihU9PKIU0HHn0jRiAPyfZX0\nWhcCsUeJB2i4tlCb2wubQgY4+QuQjxkJHrMuqSwk6o1+h1gcRKjZCW3TCUw7\nfk2zXHZDbnbO6PY653GLnDjnVOzTR3UnWsl8yYnUv6rGDnYdT4kb+AnqGios\nzitvp0ti7YFgapYN5TPrDLPLInVnt9v2zcM1sN6yvaSYPNKBK3eWKMMngnTA\nJ6T6nWBzVmHCsc9p6rsAHQX7GglCMUxKjAbJVQD7kmdSX9FKfinCd1RjXRSR\nJ0N/zj/clHML2poTHOf5ZAxUNt5Rwx8CxWs4JY366nyt7EreSHCO4DKXjLza\nlfJh6Q3Sll6hN3BIHHEkEO42O9RpEmYdaMkaQhLRKB01Nmm6Tvg3uvKrTX2W\nC1VWYtOn/HYRZtHH9G+0iuRYQAQbxI3Plezqr6zjilA+sCsV+ldTV5GZ7w6r\nB0WbDCoKRgTKM4q5kqXZpDWDA0v9xA23AuVfVB8cmQn09RKsBEesY1HwrJ/M\nbDhJKKOn4v4ybWv8MrtXzRvT3odE/M7LFXhQV8DuJdZzqICYfA4dtbv4Tsp6\n4gV/iorBG6JK1dbM9ORty3jmnH3YOR6ocaV7o87fUAwOFKUeau9j2iuOaW/+\nT9J0\r\n=0rW9\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIA9aTh3M1qvyW5eYveeyw3hzDAvWJkbEAPdQ29pp1sO4AiEAkcjO8aUez5N0mo4mWHtSBz3POM1n46H+TT1MbwY6KI4="}],"size":2744,"noattachment":false,"key":"/hypercore-crypto/-/hypercore-crypto-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/hypercore-crypto_1.0.0_1530195105066_0.4025460478834475"},"_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":1530195105173,"_cnpm_publish_time":1530195105173,"dist-tags":{"latest":"3.7.0"}}