Skip to content

mafintosh/hash-to-port

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Hash a value to a valid port

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Packages

No packages published