Socket
Socket
Sign inDemoInstall

string2compact

Package Overview
Dependencies
2
Maintainers
9
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    string2compact

Convert 'hostname:port' strings to BitTorrent's compact ip/host binary returned by Trackers


Version published
Weekly downloads
3.4K
decreased by-22.44%
Maintainers
9
Install size
70.6 kB
Created
Weekly downloads
 

Changelog

Source

2.0.1 (2023-01-25)

Bug Fixes

  • deps: update dependency addr-to-ip-port to v2 (#34) (935bae0)

Features

BREAKING CHANGES

  • ESM only

Readme

Source

string2compact ci npm downloads javascript style guide

Convert 'hostname:port' strings to BitTorrent's compact ip/host binary returned by Trackers

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.

install

npm install string2compact

usage

single string2compact
var string2compact = require('string2compact')
var compact = string2compact('10.10.10.5:65408')
console.log(compact) // new Buffer('0A0A0A05FF80', 'hex')
tranform multiple into one buffer
var compacts = string2compact([ '10.10.10.5:128', '100.56.58.99:28525' ])
console.log(compacts) // new Buffer('0A0A0A05008064383a636f6d', 'hex')

license

MIT. Copyright (c) Feross Aboukhadijeh and WebTorrent, LLC.

Keywords

FAQs

Last updated on 25 Jan 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc