{"name":"chacha20-universal","version":"1.0.2","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":"2da4e28500d2cf09a8f22dc34a31f9c32f2ce53a","_id":"chacha20-universal@1.0.2","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-HAvlrif2CZCoxvPH6AWID62C5Qnjro5+c+AJNlJ6h8BpvSVecLqbcTLG6tSBLooMkbWILAvem7c+gUwKVjuWcg==","shasum":"b37457ec7f6db94abe592b790da56ef6e6378bba","tarball":"http://registry-npm.ywwl.com/chacha20-universal/download/chacha20-universal-1.0.2.tgz","fileCount":4,"unpackedSize":28177,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe6hIdCRA9TVsSAnZWagAAdNEP/Aqh8jCoimfetmt/ADJm\nddTMJcm8qc+Dd05BMUgJJ/y/yBwxeMqOeHnesprzfc+IMcFe1cIK3qsffH7M\nbh5q2wjkzoG/rI8gzHjTZa2PeGt9zvguCt/QMquPOUZnxkbk0E0KsuBiwf6H\nn7hCyjlBLDMgfsvfIno0zNjxmoaF55jFzfUy3sRd3o1BCxYsD69FdTFBn+ph\nn4a/2odfev7zwxwm8WN65AF2x32ChdMMmc4IytV9Ju5+KLk3W0AZb1lr6syA\nQ4q53IgvAMym+4tzQyGYWalPWUOuvbQBu+9LtArMpZSXe34+oKHIAzzQ/KFi\npb2X4xTB45EggL6DujnxzkxP8pzMTC/zulyNKRA3MnkOxQShKhtM5iqTpK4D\nOYuqfMyNLpVP6TARImGNTUZRbytEzITDF9TcNFCgruIwpphuNzRKprbQWLGK\nLfLnm1uBG+dpMosJ9O6l9qR7X6I4FrhRtyoKEyTr5xnrPhmuM46V2dPCJA/K\nPKGZWyWbs+fl/oQZwX1iyw9Deey/b/PqQ7xxmtPDCgYudYT/AcAJgANIFANs\nTQ9wTLnDlOKl/o+1+mZztJ38BH0KM7uRtq6Nt6452pp3nWcptE2yyFYWBB/O\nadrRmGnqIK1jzTpqGC75Wj25wWftcsUvwHoshUSb4Ndt0SjnEGapxhsBnDPT\nc0Z7\r\n=mz2E\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHZr06g9bd5/Fnti4+i98gGc31/s+8iV8l5i3eT4Ws24AiA7UhMPzzpcveTNw2VWR695B1HORnlTcfULEWus+GXF/w=="}],"size":5446,"noattachment":false,"key":"/chacha20-universal/-/chacha20-universal-1.0.2.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.2_1592398364905_0.5043604277729345"},"_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":1592398365002,"_cnpm_publish_time":1592398365002,"dist-tags":{"latest":"1.0.4"}}