Hard CIDR
CIDR calculation functions to simplify complex network maps. Heavily influence by the functions available in Terraform. However, these only support IPv4. IPv6 might be supported later if there is sufficient demand.
install
npm i @sophosoft/hard-cidr
functions
cidrsubnet
Calculate a single subnet from a given CIDR range and additional bits, with an optional index.
// 172.18.0.0/16
cidrsubnets
Calculate a sequence of non-overlapping, non-gapped subnets from a given CIDR range
// [10.1.0.0/19, 10.1.32.0/23, 10.1.34.0/25, 10.1.34.128/25]
cidrhost
Calculate a single host ip from a given CIDR range
// 10.12.112.16