{"name":"sodium-secretstream","version":"1.1.1","description":"Wraps libsodiums secretstream in a higher level abstraction","main":"index.js","dependencies":{"b4a":"^1.1.1","sodium-universal":"^4.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.1.1","gitHead":"7a5117f4bec3880fa0d7e95fef6a8a6e77500d78","_nodeVersion":"20.11.1","_npmVersion":"10.7.0","dist":{"integrity":"sha512-9lRQtNdQYmANo+sgNjEQafKrd/N4ojqv17E8wOzx3yOCaOJ5Gb4MuXoYq2Nv4Xo9Kt2fOROYcmV24bamu86c8A==","shasum":"77c3abe5312c06798d2408f2ce2eed8b841fb47b","tarball":"http://registry-npm.ywwl.com/sodium-secretstream/download/sodium-secretstream-1.1.1.tgz","fileCount":5,"unpackedSize":5496,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCtSdijYmAxfwSokrg1xOCnUQKtYd4cYCp3AFXORWDBTQIgX/SKiUn/q07FYB9Iei9UaXroKToPRIJn4xbBJdIW2TM="}],"size":2003,"noattachment":false,"key":"/sodium-secretstream/-/sodium-secretstream-1.1.1.tgz"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/sodium-secretstream_1.1.1_1728062632774_0.7923398800122352"},"_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":1728062633001,"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"}],"_cnpm_publish_time":1728062633001,"dist-tags":{"latest":"1.2.0"}}