{"_id":"hyperdht-address","_rev":"5-cfed1582cb4df36983271bb709203f0f","name":"hyperdht-address","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.0":{"name":"hyperdht-address","version":"1.0.0","author":{"name":"Holepunch Inc"},"license":"Apache-2.0","_id":"hyperdht-address@1.0.0","maintainers":[{"name":"d_cassidy","email":"dominic@cassidy.casa"}],"homepage":"https://github.com/holepunchto/hyperdht-address","bugs":{"url":"https://github.com/holepunchto/hyperdht-address/issues"},"dist":{"shasum":"cf21645baa962bb1b8273ec8158b823247eadaaf","tarball":"https://registry.npmjs.org/hyperdht-address/-/hyperdht-address-1.0.0.tgz","fileCount":5,"integrity":"sha512-ajUwu5FhzOTvvrcrufw6csulnhLj93B/FaRmMrnwlUH65L46iggBSUTB4wAXtpMyufVYcNvBIjxJAg3cEOqE8Q==","signatures":[{"sig":"MEYCIQCjW4wYT4O7iV0zkeaCJJU6+SBbFSJ7EkeHr/QhvdCOOwIhAMZighi7ItkSLAuLSiqE7TjVgrMKN8wny7g2Ikfxqo2O","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13648},"main":"index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./package":"./package.json"},"gitHead":"c04b34cdc6f5e72a0bb9afd369ec896b8d2a5197","scripts":{"lint":"lunte","test":"prettier . --check && lunte && brittle-bare test/index.js","format":"prettier . --write"},"_npmUser":{"name":"d_cassidy","email":"dominic@cassidy.casa"},"repository":{"url":"git+https://github.com/holepunchto/hyperdht-address.git","type":"git"},"_npmVersion":"11.6.1","description":"hyperdht-address","directories":{},"_nodeVersion":"24.11.0","dependencies":{"hyperschema":"^1.20.1","compact-encoding":"^2.19.0"},"_hasShrinkwrap":false,"devDependencies":{"b4a":"^1.8.0","lunte":"^1.2.0","brittle":"^3.19.0","prettier":"^3.6.2","prettier-config-holepunch":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hyperdht-address_1.0.0_1771929408992_0.9293028632935598","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"hyperdht-address","version":"1.0.1","author":{"name":"Holepunch Inc"},"license":"Apache-2.0","_id":"hyperdht-address@1.0.1","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"d_cassidy","email":"dominic@cassidy.casa"}],"homepage":"https://github.com/holepunchto/hyperdht-address","bugs":{"url":"https://github.com/holepunchto/hyperdht-address/issues"},"dist":{"shasum":"9515be25c931990e03198b2c93f9ceaebe85fd50","tarball":"https://registry.npmjs.org/hyperdht-address/-/hyperdht-address-1.0.1.tgz","fileCount":7,"integrity":"sha512-v817eJkhryWNtMGQHLxVo6jtfEeIV9k429fRUWUKkp1bm+3/rzH8r5BFef9VT7Jq4Tvgt0Gw11FV32CacsqMZA==","signatures":[{"sig":"MEQCIA6BaceIaNI9oFAGNBBwjYIXYdAStCFJnol1lyglAINyAiBvBjEXa5fHo9GhO+UqUMwMF2SRS5tjEZ7TYSktaL3EiA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":16202},"main":"index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./package":"./package.json"},"gitHead":"c90abdf94ad4bf47e3ae90d8c4d86762ff28668c","scripts":{"lint":"lunte","test":"prettier . --check && lunte && brittle-bare test/index.js","format":"prettier . --write"},"_npmUser":{"name":"d_cassidy","email":"dominic@cassidy.casa"},"repository":{"url":"git+https://github.com/holepunchto/hyperdht-address.git","type":"git"},"_npmVersion":"11.6.1","description":"hyperdht-address","directories":{},"_nodeVersion":"24.11.0","dependencies":{"hyperschema":"^1.20.1","compact-encoding":"^2.19.0"},"_hasShrinkwrap":false,"devDependencies":{"b4a":"^1.8.0","lunte":"^1.2.0","brittle":"^3.19.0","prettier":"^3.6.2","prettier-config-holepunch":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hyperdht-address_1.0.1_1773179356697_0.4980916906928885","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"hyperdht-address","version":"1.1.0","author":{"name":"Holepunch Inc"},"license":"Apache-2.0","_id":"hyperdht-address@1.1.0","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"d_cassidy","email":"dominic@cassidy.casa"}],"homepage":"https://github.com/holepunchto/hyperdht-address","bugs":{"url":"https://github.com/holepunchto/hyperdht-address/issues"},"dist":{"shasum":"0a6b8772b4ad540ea6172e10ea7ed913bb7680c8","tarball":"https://registry.npmjs.org/hyperdht-address/-/hyperdht-address-1.1.0.tgz","fileCount":5,"integrity":"sha512-a7ijbyqQO2aLveVBPPaz66947bQ9kNFpwpGin43FHYXasCnRjzv72Y+wKAkx/f3lnr77Laf1sNsDoU/s/N3g2w==","signatures":[{"sig":"MEQCIDCk+lM4ducBloiBw8xcjsYgIezFIkVck0tc434/V7i8AiBY9qU5BW5hjcz7YBJ6FUSEDzZ/TqEw0YXSAx/d9t8hgg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13647},"main":"index.js","types":"./index.d.ts","exports":{".":{"types":"./index.d.ts","default":"./index.js"},"./package":"./package.json"},"gitHead":"0fd86438a1b80a662d767526603f4bf729ec5922","scripts":{"lint":"lunte","test":"prettier . --check && lunte && brittle-bare test/index.js","format":"prettier . --write"},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"repository":{"url":"git+https://github.com/holepunchto/hyperdht-address.git","type":"git"},"_npmVersion":"11.12.1","description":"hyperdht-address","directories":{},"_nodeVersion":"24.13.0","dependencies":{"hyperschema":"^1.20.1","compact-encoding":"^3.0.0"},"_hasShrinkwrap":false,"devDependencies":{"b4a":"^1.8.0","lunte":"^1.2.0","brittle":"^3.19.0","prettier":"^3.6.2","prettier-config-holepunch":"^2.0.0"},"_npmOperationalInternal":{"tmp":"tmp/hyperdht-address_1.1.0_1778000818656_0.10971649196266453","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"hyperdht-address","version":"1.1.1","description":"hyperdht-address","main":"index.js","exports":{"./package":"./package.json",".":{"types":"./index.d.ts","default":"./index.js"}},"devDependencies":{"b4a":"^1.8.0","brittle":"^3.19.0","lunte":"^1.2.0","prettier":"^3.6.2","prettier-config-holepunch":"^2.0.0"},"scripts":{"format":"prettier . --write","test":"prettier . --check && lunte && brittle-bare test/index.js","lint":"lunte"},"repository":{"type":"git","url":"git+https://github.com/holepunchto/hyperdht-address.git"},"author":{"name":"Holepunch Inc"},"license":"Apache-2.0","bugs":{"url":"https://github.com/holepunchto/hyperdht-address/issues"},"homepage":"https://github.com/holepunchto/hyperdht-address","dependencies":{"compact-encoding":"^3.0.0","hyperschema":"^1.20.1"},"gitHead":"383543e9c03a6050bf9c647a9b547d5c5d3ec3fa","types":"./index.d.ts","_id":"hyperdht-address@1.1.1","_nodeVersion":"24.13.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-Mu/+7SW2cwvHxMXswa5mOrhrS5BJyntViAuB25k8d8wNtA8eAPs4LaIq6TwN1SS/KQY02h1r+gM8cQeN/k360w==","shasum":"ae8b258b33c44a9b9bb1169d1584708cf409e1a2","tarball":"https://registry.npmjs.org/hyperdht-address/-/hyperdht-address-1.1.1.tgz","fileCount":7,"unpackedSize":16201,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIBOPqOnz91Vmtg0f77p81UBxk03MEm8VB5/CWPZPRaFVAiAPzBVwuMI4yxWihCPedFh0fFiKeWqzxyUM21zeu+2Vqw=="}]},"_npmUser":{"name":"mafintosh","email":"mathiasbuus@gmail.com"},"directories":{},"maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"d_cassidy","email":"dominic@cassidy.casa"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/hyperdht-address_1.1.1_1778003847190_0.5581421176174457"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-24T10:36:48.991Z","modified":"2026-05-05T17:57:27.508Z","1.0.0":"2026-02-24T10:36:49.156Z","1.0.1":"2026-03-10T21:49:16.833Z","1.1.0":"2026-05-05T17:06:58.811Z","1.1.1":"2026-05-05T17:57:27.397Z"},"bugs":{"url":"https://github.com/holepunchto/hyperdht-address/issues"},"author":{"name":"Holepunch Inc"},"license":"Apache-2.0","homepage":"https://github.com/holepunchto/hyperdht-address","repository":{"type":"git","url":"git+https://github.com/holepunchto/hyperdht-address.git"},"description":"hyperdht-address","maintainers":[{"name":"mafintosh","email":"mathiasbuus@gmail.com"},{"name":"d_cassidy","email":"dominic@cassidy.casa"}],"readme":"# hyperdht-address\n\nEncode and decode HyperDHT addresses.\n\n## Install\n\n```\nnpm install hyperdht-address\n```\n\n## Usage\n\n```js\nconst { encode, decode } = require('hyperdht-address')\n\nconst buf = encode(key, [{ host: '0.0.0.0', port: 12345 }])\nconst { key, nodes } = decode(buf)\n```\n\n## API\n\n#### `const buf = encode(key, [nodes])`\n\nEncode a 32-byte key and optional array of nodes into a buffer.\n\nEach node has the shape `{ host, port }`.\n\n#### `const { key, nodes } = decode(buf)`\n\nDecode a buffer into an address object with `key` (Buffer) and `nodes` (array of `{ host, port, family }`).\n\n## License\n\nApache-2.0\n","readmeFilename":"README.md"}