package
Convert 'hostname:port' strings to BitTorrent's compact ip/host binary returned by Trackers
npm install string2compactGitHub-flavored package documentation.
Across all versions.
Download trend unavailable.
Runtime metadata.
Tagged topics.
This module is the opposite of compact2string. It works in the browser with browserify. It is used by WebTorrent, and more specifically, the bittorrent-tracker and bittorrent-dht modules.
npm install string2compactvar string2compact = require('string2compact')
var compact = string2compact('10.10.10.5:65408')
console.log(compact) // new Buffer('0A0A0A05FF80', 'hex')var compacts = string2compact([ '10.10.10.5:128', '100.56.58.99:28525' ])
console.log(compacts) // new Buffer('0A0A0A05008064383a636f6d', 'hex')MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.
mafintosh
mathiasbuus@gmail.com
Estimated unpacked size across 3 packages.
75.0 kB
Includes dependencies.