min-host-bits

1.0.1 • Public • Published

min-host-bits Travis XO code style

Calculate minimum host bits needed for desired number of hosts with account for network address and broadcast address

minHostBits(256) // 9

Install

$ npm install --save min-host-bits OR $ yarn add min-host-bits

Usage

var desiredHosts = 3000;
var minimumHostBits = minHostBits(desiredHosts);
console.log(minimumHostBits) // 12

API

minHostBits(n)

Returns the minimum number of host bits accounting for the network address and broadcast address

n

n number of desired hosts

License

MIT

Package Sidebar

Install

npm i min-host-bits

Weekly Downloads

5

Version

1.0.1

License

MIT

Last publish

Collaborators

  • brh55