hyperdht-address
hyperdht-address
Last updated 7 months ago by mafintosh .
Apache-2.0 · Repository · Bugs · Original npm · Tarball · package.json
$ npm install hyperdht-address 
SYNC missed versions from official npm registry.

hyperdht-address

Encode and decode HyperDHT addresses.

Install

npm install hyperdht-address

Usage

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

Current Tags

  • 1.1.1                                ...           latest (7 months ago)

4 Versions

  • 1.1.1                                ...           7 months ago
  • 1.1.0                                ...           7 months ago
  • 1.0.1                                ...           9 months ago
  • 1.0.0                                ...           9 months ago
Maintainers (2)
Downloads
Total 10
Today 0
This Week 0
This Month 10
Last Day 0
Last Week 1
Last Month 0
Dependencies (2)
Dev Dependencies (5)
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE