{"name":"sodium-secretstream","version":"1.2.0","description":"Wraps libsodiums secretstream in a higher level abstraction","main":"index.js","dependencies":{"b4a":"^1.1.1","sodium-universal":"^5.0.0"},"devDependencies":{"standard":"^17.0.0"},"scripts":{"test":"standard"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/sodium-secretstream.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/sodium-secretstream/issues"},"homepage":"https://github.com/mafintosh/sodium-secretstream","_id":"sodium-secretstream@1.2.0","gitHead":"ca011b60dc77188c8003dd06900d763e8682c876","_nodeVersion":"22.12.0","_npmVersion":"10.9.0","dist":{"integrity":"sha512-q/DbraNFXm1KfCiiZvapmz5UC3OlpirYFIvBK2MhGaOFSb3gRyk8OXTi17UI9SGfshQNCpsVvlopogbzZNyW6Q==","shasum":"256c6e7c79907abce73038de187128c985aeed35","tarball":"http://registry-npm.ywwl.com/sodium-secretstream/download/sodium-secretstream-1.2.0.tgz","fileCount":5,"unpackedSize":5496,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCyHiANwBzV4Pu6T92YF7tnCMAJwaPm9vxfsq/tbsuemgIhAPovXC6MYBJkXqyBWZ0fpeMvEfUW51xE93ikTxZr5yaX"}],"size":2006,"noattachment":false,"key":"/sodium-secretstream/-/sodium-secretstream-1.2.0.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sodium-secretstream_1.2.0_1744483609512_0.9681125855387802"},"_hasShrinkwrap":false,"readme":"# sodium-secretstream\n\nWraps libsodium's secretstream in a higher level abstraction\n\n```\nnpm install sodium-secretstream\n```\n\n## Usage\n\n``` js\nconst { Pull, Push, keygen } = require('sodium-secretstream')\n\nconst key = keygen()\n\n// the sender\nconst push = new Push(key)\n\n// the receiver\nconst pull = new Pull(key)\n\n// send header to the other side\npull.init(push.header)\n\n// send the cipher to the other side\nconst cipher1 = push.next(Buffer.from('test'))\n\n// prints \"test\"\nconsole.log(pull.next(cipher1))\n\n// send the cipher to the other side\nconst cipher2 = push.next(Buffer.from('test 2'))\n\n// prints \"test 2\"\nconsole.log(pull.next(cipher2))\n\n// when done send a final signal\nconst cipher3 = push.final()\n\n// prints <empty buffer>\nconsole.log(pull.next(cipher3))\n\n// but sets pull.final to true\nconsole.log(pull.final)\n```\n\n## License\n\nMIT\n","publish_time":1744483609779,"_cnpm_publish_time":1744483609779,"dist-tags":{"latest":"1.2.0"}}