Socket
Book a DemoInstallSign in
Socket

hash-to-port

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hash-to-port

Hash a value to a valid port

latest
Source
npmnpm
Version
1.2.0
Version published
Maintainers
1
Created
Source

hash-to-port

Hash a value to a valid port

npm install hash-to-port

build status

Usage

var toPort = require('hash-to-port')

console.log(toPort('example.com')) // returns 22019

API

var port = toPort(value, ?from, ?to)

Hash the given value to a valid port (>= from <= to). The same value will always hash to the same port but note that two different values might hash to the same port as well

  • value
  • from <?number> (default: 1024)
  • to <?number> (default: 65535)

License

MIT

FAQs

Package last updated on 29 Nov 2020

Did you know?

Socket

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