{"_id":"ipv4-peers","_rev":"481326","name":"ipv4-peers","description":"An abstract-encoding compliant encoder for encoding a list of ipv4 peers to buffers","dist-tags":{"latest":"2.0.0"},"maintainers":[{"name":"mafintosh","email":""}],"time":{"modified":"2021-08-05T09:38:33.000Z","created":"2016-08-12T00:39:21.390Z","2.0.0":"2019-07-22T14:48:34.099Z","1.1.1":"2016-09-06T15:05:55.898Z","1.1.0":"2016-09-05T14:22:25.001Z","1.0.0":"2016-08-12T00:39:21.390Z"},"users":{},"author":{"name":"Mathias Buus","url":"@mafintosh"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/ipv4-peers.git"},"versions":{"2.0.0":{"name":"ipv4-peers","version":"2.0.0","description":"An abstract-encoding compliant encoder for encoding a list of ipv4 peers to buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^7.1.2","tape":"^4.6.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/ipv4-peers.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/ipv4-peers/issues"},"homepage":"https://github.com/mafintosh/ipv4-peers","gitHead":"f5dadecdc90d917ae953d33f41491f1302a6894a","_id":"ipv4-peers@2.0.0","_nodeVersion":"10.16.0","_npmVersion":"6.9.0","dist":{"shasum":"56db3a04c1bbde4b9035d19757821d7b66b3fbb7","size":2492,"noattachment":false,"key":"/ipv4-peers/-/ipv4-peers-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipv4-peers/download/ipv4-peers-2.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ipv4-peers_2.0.0_1563806913892_0.35500706810389193"},"_hasShrinkwrap":false,"publish_time":1563806914099,"_cnpm_publish_time":1563806914099},"1.1.1":{"name":"ipv4-peers","version":"1.1.1","description":"An abstract-encoding compliant encoder for encoding a list of ipv4 peers to buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^7.1.2","tape":"^4.6.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/ipv4-peers.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/ipv4-peers/issues"},"homepage":"https://github.com/mafintosh/ipv4-peers","gitHead":"ee15ecd007953b1148c883872e94b810a6cc28ba","_id":"ipv4-peers@1.1.1","_shasum":"85ab862a0f5214583e0518763f7e1d775ae24d76","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"85ab862a0f5214583e0518763f7e1d775ae24d76","size":2575,"noattachment":false,"key":"/ipv4-peers/-/ipv4-peers-1.1.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipv4-peers/download/ipv4-peers-1.1.1.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ipv4-peers-1.1.1.tgz_1473174355053_0.7402010192163289"},"directories":{},"publish_time":1473174355898,"_cnpm_publish_time":1473174355898,"_hasShrinkwrap":false},"1.1.0":{"name":"ipv4-peers","version":"1.1.0","description":"An abstract-encoding compliant encoder for encoding a list of ipv4 peers to buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^7.1.2","tape":"^4.6.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/ipv4-peers.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/ipv4-peers/issues"},"homepage":"https://github.com/mafintosh/ipv4-peers","gitHead":"e40c9f9cd7d9f71a23b0c0e922c5819e47b79f00","_id":"ipv4-peers@1.1.0","_shasum":"1f46f1efc2b574eb3cd8f61cbd567661216040fd","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"1f46f1efc2b574eb3cd8f61cbd567661216040fd","size":2485,"noattachment":false,"key":"/ipv4-peers/-/ipv4-peers-1.1.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipv4-peers/download/ipv4-peers-1.1.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ipv4-peers-1.1.0.tgz_1473085344423_0.21252116584219038"},"directories":{},"publish_time":1473085345001,"_cnpm_publish_time":1473085345001,"_hasShrinkwrap":false},"1.0.0":{"name":"ipv4-peers","version":"1.0.0","description":"An abstract-encoding compliant encoder for encoding a list of ipv4 peers to buffers","main":"index.js","dependencies":{},"devDependencies":{"standard":"^7.1.2","tape":"^4.6.0"},"scripts":{"test":"standard && tape test.js"},"repository":{"type":"git","url":"git+https://github.com/mafintosh/ipv4-peers.git"},"author":{"name":"Mathias Buus","url":"@mafintosh"},"license":"MIT","bugs":{"url":"https://github.com/mafintosh/ipv4-peers/issues"},"homepage":"https://github.com/mafintosh/ipv4-peers","gitHead":"1c85a6c2ac9f641ea4d38b334f7bea71d4d5908c","_id":"ipv4-peers@1.0.0","_shasum":"4ac23c5fee5d1988f611ac45ff559d639ac34e97","_from":".","_npmVersion":"2.15.9","_nodeVersion":"4.4.3","_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"dist":{"shasum":"4ac23c5fee5d1988f611ac45ff559d639ac34e97","size":2177,"noattachment":false,"key":"/ipv4-peers/-/ipv4-peers-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/ipv4-peers/download/ipv4-peers-1.0.0.tgz"},"maintainers":[{"name":"mafintosh","email":""}],"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/ipv4-peers-1.0.0.tgz_1470962360152_0.2790427210275084"},"directories":{},"publish_time":1470962361390,"_cnpm_publish_time":1470962361390,"_hasShrinkwrap":false}},"readme":"# ipv4-peers\n\nAn [abstract-encoding](https://github.com/mafintosh/abstract-encoding) compliant encoder for encoding a list of ipv4 peers to buffers.\n\n```\nnpm install ipv4-peers\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/ipv4-peers.svg?style=flat)](http://travis-ci.org/mafintosh/ipv4-peers)\n\n## Usage\n\n``` js\nvar peers = require('ipv4-peers')\n\nvar buf = peers.encode([{\n  host: '127.0.0.1',\n  port: 8080\n}, {\n  host: '127.0.0.1',\n  port: 9090\n}])\n\nconsole.log(buf) // 12 byte buffer\nconsole.log(peers.decode(buf)) // the peer list\n```\n\n## API\n\n#### `var buf = peers.encode(peerList, [buffer], [offset])`\n\nEncode a list of ipv4 peers into a buffer.\n\n#### `var peers = peers.decode(buffer, [offset], [end])`\n\nDecode a buffer into a list of peers.\n\n#### `var length = peers.encodingLength(peerList)`\n\nReturns the amount of bytes needed to encode the peers into a buffer\n\n#### `peers = peers.idLength(idByteLength)`\n\nCreate a new ipv4-peers decoder that encodes/decodes a fixed size peer id in addition to host/port. The peer id is exposed as the `.id` property on a peer object.\n\n## License\n\nMIT\n","_attachments":{},"homepage":"https://github.com/mafintosh/ipv4-peers","bugs":{"url":"https://github.com/mafintosh/ipv4-peers/issues"},"license":"MIT"}