{"versions":{"2.0.3":{"name":"@leichtgewicht/ip-codec","version":"2.0.3","description":"Small package to encode or decode IP addresses from buffers to strings.","main":"index.js","types":"types","scripts":{"lint":"standard && dtslint --localTs node_modules/typescript/lib types","test":"fresh-tape test.js","test-cov":"c8 npm run test"},"repository":{"type":"git","url":"git+https://github.com/martinheidegger/ip-codec.git"},"keywords":["ip","ipv4","ipv6","codec","codecs","buffer","conversion"],"author":{"name":"Martin Heidegger"},"license":"MIT","bugs":{"url":"https://github.com/martinheidegger/ip-codec/issues"},"homepage":"https://github.com/martinheidegger/ip-codec#readme","devDependencies":{"c8":"^7.7.3","dtslint":"^4.1.1","fresh-tape":"^5.2.4","standard":"^16.0.3","typescript":"^4.3.5"},"gitHead":"473f3ba49a5d31fe3899f5d74c446422fe25349f","_id":"@leichtgewicht/ip-codec@2.0.3","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"shasum":"0300943770e04231041a51bd39f0439b5c7ab4f0","size":6334,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@leichtgewicht/ip-codec/-/ip-codec-2.0.3.tgz","integrity":"sha512-nkalE/f1RvRGChwBnEIoBfSEYOXnCRdleKuv6+lePbMDrMZXeDQnqak5XDOeBgrPPyPfAdcCu/B5z+v3VhplGg=="},"_npmUser":{"name":"anonymous","email":"martin.heidegger@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"martin.heidegger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-codec_2.0.3_1626515292634_0.8654720488593579"},"_hasShrinkwrap":false,"publish_time":1626515292765,"_cnpm_publish_time":1626515292765,"_cnpmcore_publish_time":"2021-12-16T15:44:36.882Z","contributors":[]},"2.0.2":{"name":"@leichtgewicht/ip-codec","version":"2.0.2","description":"Small package to encode or decode IP addresses from buffers to strings.","main":"index.js","types":"types","scripts":{"lint":"standard && dtslint --localTs node_modules/typescript/lib types","test":"fresh-tape test.js","test-cov":"c8 npm run test"},"repository":{"type":"git","url":"git+https://github.com/martinheidegger/ip-codec.git"},"keywords":["ip","ipv4","ipv6","codec","codecs","buffer","conversion"],"author":{"name":"Martin Heidegger"},"license":"MIT","bugs":{"url":"https://github.com/martinheidegger/ip-codec/issues"},"homepage":"https://github.com/martinheidegger/ip-codec#readme","devDependencies":{"c8":"^7.7.3","dtslint":"^4.1.1","fresh-tape":"^5.2.4","standard":"^16.0.3","typescript":"^4.3.5"},"gitHead":"5b9aeebdd2acd0a0bb3f46c91731827d6c9982b3","_id":"@leichtgewicht/ip-codec@2.0.2","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"shasum":"862a66b3e0197109c11ddf2082a8db4c66ba6bd2","size":3747,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@leichtgewicht/ip-codec/-/ip-codec-2.0.2.tgz","integrity":"sha512-PjsLKLzJ0jWM1iM4xdYkrMyonAHP4kHGiXm81FRNfcnjToQA9UOknwZE28bxq0AGmEAMVBPSuuHurzla2wyYyA=="},"_npmUser":{"name":"anonymous","email":"martin.heidegger@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"martin.heidegger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-codec_2.0.2_1625133625687_0.8987495300480688"},"_hasShrinkwrap":false,"publish_time":1625133625877,"_cnpm_publish_time":1625133625877,"_cnpmcore_publish_time":"2021-12-16T15:44:37.161Z","contributors":[]},"2.0.1":{"name":"@leichtgewicht/ip-codec","version":"2.0.1","description":"Small package to encode or decode IP addresses from buffers to strings.","main":"index.js","types":"types","scripts":{"lint":"standard && dtslint --localTs node_modules/typescript/lib types","test":"fresh-tape test.js","test-cov":"c8 npm run test"},"repository":{"type":"git","url":"git+https://github.com/martinheidegger/ip-codec.git"},"keywords":["ip","ipv4","ipv6","codec","codecs","buffer","conversion"],"author":{"name":"Martin Heidegger"},"license":"MIT","bugs":{"url":"https://github.com/martinheidegger/ip-codec/issues"},"homepage":"https://github.com/martinheidegger/ip-codec#readme","devDependencies":{"c8":"^7.7.3","dtslint":"^4.1.1","fresh-tape":"^5.2.4","standard":"^16.0.3","typescript":"^4.3.5"},"gitHead":"5a60cf5e77243abc0fbf3ec0f0dd3870ea8c1711","_id":"@leichtgewicht/ip-codec@2.0.1","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"shasum":"a29f6bc26b6b4bc10dab78b2da52550fd432d74b","size":3721,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@leichtgewicht/ip-codec/-/ip-codec-2.0.1.tgz","integrity":"sha512-0mln2idTl8eua+JADT18dSImamEaIf5rwH7ZqqISXSETkUMdTfbhP5yV/KdpOj4RSElApZjmqglTQzqHpSlPaQ=="},"_npmUser":{"name":"anonymous","email":"martin.heidegger@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"martin.heidegger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-codec_2.0.1_1625128065547_0.43722304706542947"},"_hasShrinkwrap":false,"publish_time":1625128065649,"_cnpm_publish_time":1625128065649,"_cnpmcore_publish_time":"2021-12-16T15:44:37.382Z","contributors":[]},"2.0.0":{"name":"@leichtgewicht/ip-codec","version":"2.0.0","description":"Small package to encode or decode IP addresses from buffers to strings.","main":"index.js","types":"types","scripts":{"lint":"standard && dtslint --localTs node_modules/typescript/lib types","test":"fresh-tape test.js","test-cov":"c8 npm run test"},"repository":{"type":"git","url":"git+https://github.com/martinheidegger/ip-codec.git"},"keywords":["ip","ipv4","ipv6","codec","codecs","buffer","conversion"],"author":{"name":"Martin Heidegger"},"license":"MIT","bugs":{"url":"https://github.com/martinheidegger/ip-codec/issues"},"homepage":"https://github.com/martinheidegger/ip-codec#readme","devDependencies":{"c8":"^7.7.3","dtslint":"^4.1.1","fresh-tape":"^5.2.4","standard":"^16.0.3","typescript":"^4.3.5"},"gitHead":"71fb675b4fe016abcbdeb17d48a307bfbdadf586","_id":"@leichtgewicht/ip-codec@2.0.0","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"shasum":"7060cb38312c6268f5f7ba77a0d69999e83d2d17","size":4435,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@leichtgewicht/ip-codec/-/ip-codec-2.0.0.tgz","integrity":"sha512-Yhh6NYRv0V+Eo7qPmWKCtnaxjJfcM2OGiuJk4GZBIYcBdnqFHKYkh8GHNKTcSRdagxx3I0rQzqDktDkuBmMRqQ=="},"_npmUser":{"name":"anonymous","email":"martin.heidegger@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"martin.heidegger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-codec_2.0.0_1625127016845_0.886924448238269"},"_hasShrinkwrap":false,"publish_time":1625127016947,"_cnpm_publish_time":1625127016947,"_cnpmcore_publish_time":"2021-12-16T15:44:37.563Z","contributors":[]},"1.0.0":{"name":"@leichtgewicht/ip-codec","version":"1.0.0","description":"Small package to encode or decode IP addresses from buffers to strings.","main":"index.js","types":"types","scripts":{"lint":"standard && dtslint --localTs node_modules/typescript/lib types","test":"fresh-tape test.js","test-cov":"c8 npm run test"},"repository":{"type":"git","url":"git+https://github.com/martinheidegger/ip-codec.git"},"keywords":["ip","ipv4","ipv6","codec","codecs","buffer","conversion"],"author":{"name":"Martin Heidegger"},"license":"MIT","bugs":{"url":"https://github.com/martinheidegger/ip-codec/issues"},"homepage":"https://github.com/martinheidegger/ip-codec#readme","devDependencies":{"c8":"^7.7.3","dtslint":"^4.1.1","fresh-tape":"^5.2.4","standard":"^16.0.3","typescript":"^4.3.5"},"gitHead":"fa42bb9f99af5564b8963a43e81debdc0773e34c","_id":"@leichtgewicht/ip-codec@1.0.0","_nodeVersion":"16.4.0","_npmVersion":"7.18.1","dist":{"shasum":"3b153fdbfb2d7ada087ff9ad9bcc045d9deabf5e","size":4374,"noattachment":false,"tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@leichtgewicht/ip-codec/-/ip-codec-1.0.0.tgz","integrity":"sha512-4w160F8VQBHwu4V5Viv/694JqBeeDrfiwn8evX+Xu5XkZkGNaMNHJar0rwGIOSFwXYsIwDtSnpATmmpEEOaWCA=="},"_npmUser":{"name":"anonymous","email":"martin.heidegger@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"martin.heidegger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-codec_1.0.0_1625119866106_0.5899376372888863"},"_hasShrinkwrap":false,"publish_time":1625119866252,"_cnpm_publish_time":1625119866252,"_cnpmcore_publish_time":"2021-12-16T15:44:37.782Z","contributors":[]},"2.0.4":{"name":"@leichtgewicht/ip-codec","version":"2.0.4","description":"Small package to encode or decode IP addresses from buffers to strings.","main":"index.cjs","types":"types","exports":{".":{"import":"./index.mjs","require":"./index.cjs"}},"scripts":{"lint":"standard && dtslint --localTs node_modules/typescript/lib types","test":"npm run lint && npm run unit","unit":"fresh-tape test.mjs","coverage":"c8 npm run unit","prepare":"node ./scripts/esm2umd.mjs ipCodec"},"repository":{"type":"git","url":"git+https://github.com/martinheidegger/ip-codec.git"},"keywords":["ip","ipv4","ipv6","codec","codecs","buffer","conversion"],"author":{"name":"Martin Heidegger"},"license":"MIT","bugs":{"url":"https://github.com/martinheidegger/ip-codec/issues"},"homepage":"https://github.com/martinheidegger/ip-codec#readme","devDependencies":{"@definitelytyped/dtslint":"0.0.112","c8":"^7.11.2","esm2umd":"^0.2.0","fresh-tape":"^5.5.3","standard":"^17.0.0","typescript":"^4.6.4"},"gitHead":"49c204316b0ad107e958ff9b07131e1595156be0","_id":"@leichtgewicht/ip-codec@2.0.4","_nodeVersion":"14.17.5","_npmVersion":"6.14.14","dist":{"integrity":"sha512-Hcv+nVC0kZnQ3tD9GVu5xSMR4VVYOteQIr/hwFPVEvPdlXqgGEuRjiheChHgdM+JyqdgNcmzZOX/tnl0JOiI7A==","shasum":"b2ac626d6cb9c8718ab459166d4bb405b8ffa78b","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@leichtgewicht/ip-codec/-/ip-codec-2.0.4.tgz","fileCount":6,"unpackedSize":17660,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkH/B98zQebwR+kdqfzifjVK87GMUYGofVREGzMfVd/AIgL2Ii9DUsN1ijABK+uY9ZiR7sfk7UIjpCTyXwywnDJps="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJieUhCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrtSA//XcOipPBTEs5atqW1vCZ8jCMR3a1fwvp1ZPlcbAHiM/Q6bRmb\r\nEgKaDvdpRi3vksOmxJ9D2QNsbSYr/bW85laT+l/BNpQawoIzOTgEQwYJ3+mH\r\nyzny1c2XHICtwduSjtCkhSN5oJvq4eg45EBB9J23mI6tneIasKav4L0WJjG+\r\nlyyEwL4TNFJ/G+cVRsYun+pd238/7+OgGeTlT4ALgbvul6aXU/0a5TlQUYkT\r\nNySpJ+IMic01rqJEnlVKvYxLzed3gmYD1b9lWS9WgxM/guZm/9ljYZ03Kfk3\r\noe8Xf8Eh/qNkzXza+Pdku+a5HWkPt8TtYId6IXdS+KXkzi8Ac4rnQqB2/Zmc\r\nNDGmCYCuZvFKfx4jepi9zrzJawTGMw53OB55etrAd4Q1gfZcOd+tnm7qAtRK\r\nn4YN57XgYZfHOBl458H7omeMNLhaQ1KY2zMzt3buzC2tXVPnk4i+ZXv65iS4\r\neW5AitXreEHBj6L17pJwCRVQWuk+zNpOO/ycGA8jDYia0nsivbX/IoJGY5BA\r\niffi5Lohld3I59SwrV+oM+uaaRre+Yx3b+Os5OoFSxZDNfJ0pxdGrT0YnDuE\r\nMYxvnwgcFyD1gp6npf9L8NBV1IpmhVWcYJjPPkeChm+vgJw9jDghUj0T9G/C\r\nOfjO1eKPIg52+wQ2ECpGXW2kyA/QKTRRQJU=\r\n=p2zo\r\n-----END PGP SIGNATURE-----\r\n","size":5059},"_npmUser":{"name":"anonymous","email":"martin.heidegger@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"martin.heidegger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-codec_2.0.4_1652115522635_0.6431655472954532"},"_hasShrinkwrap":false,"_cnpmcore_publish_time":"2022-05-09T16:58:47.647Z","contributors":[]},"2.0.5":{"name":"@leichtgewicht/ip-codec","version":"2.0.5","description":"Small package to encode or decode IP addresses from buffers to strings.","main":"index.cjs","types":"types","exports":{".":{"types":"./types/index.d.ts","import":"./index.mjs","require":"./index.cjs"}},"scripts":{"lint":"standard && dtslint --localTs node_modules/typescript/lib types","test":"npm run lint && npm run unit","unit":"fresh-tape test.mjs","coverage":"c8 npm run unit","prepare":"npx @leichtgewicht/esm2umd ipCodec"},"repository":{"type":"git","url":"git+https://github.com/martinheidegger/ip-codec.git"},"keywords":["ip","ipv4","ipv6","codec","codecs","buffer","conversion"],"author":{"name":"Martin Heidegger"},"license":"MIT","bugs":{"url":"https://github.com/martinheidegger/ip-codec/issues"},"homepage":"https://github.com/martinheidegger/ip-codec#readme","devDependencies":{"@definitelytyped/dtslint":"0.2.19","@leichtgewicht/esm2umd":"^0.4.0","c8":"^9.1.0","fresh-tape":"^5.5.3","standard":"^17.1.0","typescript":"^5.4.3"},"_id":"@leichtgewicht/ip-codec@2.0.5","gitHead":"7312f356342ec0728767fb0a1d9a4b25a053f8e5","_nodeVersion":"20.11.1","_npmVersion":"10.2.4","dist":{"integrity":"sha512-Vo+PSpZG2/fmgmiNzYK9qWRh8h/CHrwD0mo1h1DzL4yzHNSfWYujGTYsWGreD000gcgmZ7K4Ys6Tx9TxtsKdDw==","shasum":"4fc56c15c580b9adb7dc3c333a134e540b44bfb1","tarball":"http://123.232.10.234:8212/nexus/content/groups/npm-public/@leichtgewicht/ip-codec/-/ip-codec-2.0.5.tgz","fileCount":6,"unpackedSize":17710,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYdWZFW3dg7gznLfcUTJf4Z4SoKQFZlK0ozL2qOvgadAIhAKcZ1rIusAtGXSuF7EK9H19KDpMQ509iGd2V5b7Dao5j"}]},"_npmUser":{"name":"anonymous","email":"martin.heidegger@gmail.com"},"directories":{},"maintainers":[{"name":"anonymous","email":"martin.heidegger@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ip-codec_2.0.5_1711514534522_0.9941210286100588"},"_hasShrinkwrap":false,"contributors":[]}},"dist-tags":{"latest":"2.0.5"},"name":"@leichtgewicht/ip-codec","time":{"created":"2022-01-27T12:31:30.340Z","modified":"2024-03-27T05:03:35.256Z","2.0.3":"2021-07-17T09:48:12.765Z","2.0.2":"2021-07-01T10:00:25.877Z","2.0.1":"2021-07-01T08:27:45.649Z","2.0.0":"2021-07-01T08:10:16.947Z","1.0.0":"2021-07-01T06:11:06.252Z","2.0.4":"2022-05-09T16:58:42.800Z","2.0.5":"2024-03-27T04:42:14.678Z"},"readme":"# @leichtgewicht/ip-codec\n\nSmall package to encode or decode IP addresses from buffers to strings.\nSupports IPV4 and IPV6.\n\n## Usage\n\nThe basics are straigthforward\n\n```js\nimport { encode, decode, sizeOf, familyOf } from '@leichtgewicht/ip-codec'\n\nconst uint8Array = encode(\"127.0.0.1\")\nconst str = decode(uint8Array)\n\ntry {\n  switch sizeOf(str) {\n    case 4: // IPv4\n    case 16: // IPv6\n  }\n  switch familyOf(str) {\n    case: 1: // IPv4\n    case: 2: // IPv6\n  }\n} catch (err) {\n  // Invalid IP\n}\n```\n\nBy default the library will work with Uint8Array's but you can bring your own buffer:\n\n```js\nconst buf = Buffer.alloc(4)\nencode('127.0.0.1', buf)\n```\n\nIt is also possible to de-encode at a location inside a given buffer\n\n```js\nconst buf = Buffer.alloc(10)\nencode('127.0.0.1', buf, 4)\n```\n\nAllocation of a buffer may be difficult if you don't know what type the buffer:\nyou can pass in a generator to allocate it for you:\n\n```js\nencode('127.0.0.1', Buffer.alloc)\n```\n\nYou can also de/encode ipv4 or ipv6 specifically:\n\n```js\nimport { v4, v6 } from '@leichtgewicht/ip-codec'\n\nv4.decode(v4.encode('127.0.0.1'))\nv6.decode(v6.encode('::'))\n```\n\n## History\n\nThe code in this package was originally extracted from [node-ip](https://github.com/indutny/node-ip) and since improved.\n\nNotable changes are the removal of the `Buffer` dependency and better support for detection of\nformats and allocation of buffers.\n\n## License\n\n[MIT](./LICENSE)","users":{}}