{"name":"chacha20-universal","version":"1.0.4","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":"aa95ecd75c37ca7b1d9f3b749eb2fe34f5484739","_id":"chacha20-universal@1.0.4","_nodeVersion":"12.18.0","_npmVersion":"6.14.4","dist":{"integrity":"sha512-/IOxdWWNa7nRabfe7+oF+jVkGjlr2xUL4J8l/OvzZhj+c9RpMqoo3Dq+5nU1j/BflRV4BKnaQ4+4oH1yBpQG1Q==","shasum":"e8a33a386500b1ce5361b811ec5e81f1797883f5","tarball":"http://registry-npm.ywwl.com/chacha20-universal/download/chacha20-universal-1.0.4.tgz","fileCount":4,"unpackedSize":27949,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJe61DbCRA9TVsSAnZWagAA1gIP/2C/Ek0dsrVl/7HAY0MR\njOmw17RQBf78626BgfSjUwiKYAXimNpo0PI7nGgoXI61Aat/yyjOSBv+TdG0\nTskjCc1TiBXtXHEfx9IS4HpXmkjTLhrYw79TXbgLMMNrxwx5xW6uRKtT9IX9\n8V2RuMg16QyYHSAJOU6KSvsFjaK4oVttUeia6UCU3OohjxCg6Qx+5czVnD1t\nD236jE/MRK4gE5YK33WME6mLm5qfSZBIONGY3NaSV2VnMaPqO3dbZ60y5EZm\nVlhwzND//CNaTLs9TscLCxoGNl7YjH/1GorrF0CgaR1+6PDLvAPRLCQ3OBqO\ny+paibtwtDlTNa+ik++x0tZ0NQ8LS6Ytbvkgz3c1e1uuCkj+2wQUObRR1I3Q\nMToc3rdzD3ZvxtjSe3wXNGsEg0nwNdYLe4RozuYbfPTlS41Z+flNrJYjJB8q\nrgJk5bMlt4PQ5gPVo1GwK3xt2C1CXHdA6VbJMUQkmmdCHTivtOsS/6YU86Jz\nYFiMA3r2ItB1ziEP5A+BS0zKzTIXQJ8zix+HtJFz4Bewree/28MT3nly8p8v\nR4gU1I+f7ggrZYDY1X+lEGIRJGbCFvdw88jc4or1c3KwyQZHIS4+UwQoL6Hn\nww5L5MZu/D5yoHOXkgmKxNUkw77OuQSM+BboGtGX2ZWYp4/poLncKPyh4Geh\nr450\r\n=vKx5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHP354GYyywpYN5bu4Q5IwixacCDeuE+m0Z5Ao5Og0p+AiBI+tjeLbbCrQapg1Hk9ukNaixNbkJJKZeNgPGHTVmbrw=="}],"size":5357,"noattachment":false,"key":"/chacha20-universal/-/chacha20-universal-1.0.4.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.4_1592479962806_0.866463355889894"},"_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":1592479962928,"_cnpm_publish_time":1592479962928,"dist-tags":{"latest":"1.0.4"}}