Calculate minimum host bits needed for desired number of hosts with account for network address and broadcast address
minHostBits(256) // 9
$ npm install --save min-host-bits
OR $ yarn add min-host-bits
var desiredHosts = 3000;
var minimumHostBits = minHostBits(desiredHosts);
console.log(minimumHostBits) // 12
Returns the minimum number of host bits accounting for the network address and broadcast address
n number of desired hosts
min-prefix-length - 🔢 Calculate the minimum prefix length for an IPv4 subnet based on a desired number of host
ip-class - 🔠 Return the classful network class (A, B, C, D, E) of an IPv4 address
MIT