cidr-ip-utils
Utilities for translating, merging, and sorting CIDR notation into IP ranges. IPv4 ONLY. Support for Node.js and browser environments.
API
See test/index.js
for more examples.
mergeCidrRanges(cidrStrings)
Merge and sort a list of CIDR strings into a list of IPv4 ranges.
;# or const mergeCidrRange = ; assert;
ip4ToInt(ipString)
Useful for comparing IP addresses.
; assert;
compareIp4(ipA, ipB)
Comparator to sort IP strings with Array.sort().
; const ips = '127.0.0.1' '200.255.0.0' '10.0.0.3';ips; assert;