# hyperdht-address

> hyperdht-address

Latest version **1.1.1** (published 2026-05-05) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install hyperdht-address
pnpm add hyperdht-address
yarn add hyperdht-address
bun add hyperdht-address
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2026-05-05 |
| First published | 2026-02-24 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 15.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Holepunch Inc |
| Maintainers | mafintosh, d_cassidy |

## Links

- npm: https://www.npmjs.com/package/hyperdht-address
- Repository: https://github.com/holepunchto/hyperdht-address
- Issues: https://github.com/holepunchto/hyperdht-address/issues
- npm.io page: https://npm.io/package/hyperdht-address

## Dependencies (2)

- [hyperschema](https://npm.io/package/hyperschema.md) ^1.20.1
- [compact-encoding](https://npm.io/package/compact-encoding.md) ^3.0.0

## Recent versions

- 1.1.1 (latest) — 2026-05-05
- 1.1.0 — 2026-05-05
- 1.0.1 — 2026-03-10
- 1.0.0 — 2026-02-24

## README

# hyperdht-address

Encode and decode HyperDHT addresses.

## Install

```
npm install hyperdht-address
```

## Usage

```js
const { encode, decode } = require('hyperdht-address')

const buf = encode(key, [{ host: '0.0.0.0', port: 12345 }])
const { key, nodes } = decode(buf)
```

## API

#### `const buf = encode(key, [nodes])`

Encode a 32-byte key and optional array of nodes into a buffer.

Each node has the shape `{ host, port }`.

#### `const { key, nodes } = decode(buf)`

Decode a buffer into an address object with `key` (Buffer) and `nodes` (array of `{ host, port, family }`).

## License

Apache-2.0

---
_Source: https://npm.io/package/hyperdht-address · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
