{"name":"chacha20-universal","version":"1.0.3","description":"chacha20 in pure javascript","main":"index.js","scripts":{"test":"node test"},"repository":{"type":"git","url":"git+https://github.com/chm-diederichs/chacha20-universal.git"},"keywords":["chacha20"],"author":{"name":"Christophe Diederichs"},"license":"ISC","bugs":{"url":"https://github.com/chm-diederichs/chacha20-universal/issues"},"homepage":"https://github.com/chm-diederichs/chacha20-universal#readme","dependencies":{"nanoassert":"^2.0.0"},"gitHead":"b0ec2c6d51a157cc56526d0509db5f9c2b41f661","_id":"chacha20-universal@1.0.3","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-Uzwdui5K/T7Ueubhmo4bte78jw9PYhHfgFTzfNMqhdeSIiIycVnXRA93J/iWuIcoFjVjOP/reZU8VUQF/C1fvA==","shasum":"43acc6817caec9b6a6ac192251eb39fe7ac70d3f","tarball":"http://registry-npm.ywwl.com/chacha20-universal/download/chacha20-universal-1.0.3.tgz","fileCount":4,"unpackedSize":27946,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6jaiCRA9TVsSAnZWagAAcZ4QAKMm5vWc8Fol1VbkP1BD\n7Nn/QXTPx0cBEap4c5F2xU8D99e9AHUZ4lSvKtd2GLnvofV3qeF0LWmCbMeF\nI3gzlVJF7tedkD0iRP0AT7w6RH3xOKCcsMRlHzUne7ZAjSPpyny1TcJa6J0D\nm36NJp72+92MhiufqyMU33khmvuOamXpC3a3ow+7nRljT/irHodcOEwE8Lbj\n2XaP4+28wJOA0xF8XbpVv/WyZ5jItP41dDY/7fcWU6lJ2VSiDhCTaA12/SPs\nQ94rTwzEnpTb6F/+TqgtV7hu7QVp9KX0fJCGxgtwlMbS7RT/7FK52aGvp88d\nm1l2gajPYxGIwBZWW3MY/70TE8N9hmSHO6D9+8gKMN/Sa8P0SJclwVsuGO6D\nOVrsX8ihcmwnOA4hKE4quOh9SgtLdazzdSIC9WxMOE22CVVQJ5TQiWwi0eLL\n+M4TAoHrksCg6O7f3eXImFrEPNPuuudIsk2jsCuIlgF/quC/wvls7GW0M1B8\n/D6+3X6willnnZUuIDyskliiFQy8if4RJBypJ9MqYqT1ey1K7uiU2hbj7aEc\nAiMnmJPQPTcbV65QDnbJ84mbeFfRyBx4MqEaAIBvjnhdL27GzZ1nqORQmoJJ\nb8ZlaB5q6gygDBugg5oBwKQRPDle9sPwsQbn6smB/fX3gBIH28MehIXfi3EW\ntqn2\r\n=Cis3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAraEINnh2oc20J78ZOBPRnLk9RgifKlTJAWbKS90FSIAiAUdfHEkdSZht4IqqCuFe6G+TCEvSIN0MSZJYq2eYo4rw=="}],"size":5354,"noattachment":false,"key":"/chacha20-universal/-/chacha20-universal-1.0.3.tgz"},"maintainers":[{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"}],"_npmUser":{"name":"chm-diederichs","email":"christophe.diederichs@googlemail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/chacha20-universal_1.0.3_1592407714074_0.9527030021742295"},"_hasShrinkwrap":false,"readme":"# chacha20-universal\n\nChacha20 implemented in Javascript.\n\n```\nnpm install chacha20-universal\n```\n\n## Usage\n\n``` js\nvar crypto = require('crypto')\nvar Chacha20 = require('chacha20')\n\nvar key = crypto.randomBytes(32)\nvar nonce = crypto.randomBytes(24)\nvar out = Buffer.alloc(5)\nvar xor = new Chacha20(nonce, key)\n\nxor.update(out, Buffer.from('hello'))\nxor.update(out, Buffer.from('world'))\n\nconsole.log(out)\n// e.g. <Buffer 7c 77 23 51 f9>\n\nxor.finalize()\n```\n\n## API\n\n#### `var xor = chacha20(nonce, key, [counter])`\n\nCreate a new xor instance.\n\n`nonce` should be a 12 byte buffer/uint8array and `key` should be 32 byte. An optional `counter` may be passed as a number.\n\n#### `xor.update(output, input)`\n\nUpdate the xor instance with a new `input` buffer, the result is written to `output` buffer. `output` should be the same byte length as `input`.\n\n#### `xor.final()`\n\nCall this method last. Clears internal state.\n\n## License\n\nMIT\n","publish_time":1592407714196,"_cnpm_publish_time":1592407714196,"dist-tags":{"latest":"1.0.4"}}