Releases: silverwind/cidr-tools
11.0.0
expandCidr
now returns a generator instead of array to enable immediate consumption of generated IPs and eliminate a potential memory/performance problem in the module. To migrate previous Array use cases:
expandCidr(nets)
-> Array.from(expandCidr(nets))
Be aware that passing large networks that contain millions of IPs can result in memory exhaustion and slow execution time. It's recommended to validate the amount of IPs first, for example, like this:
const {start, end} = parseCidr(net);
if (end - start >= 1000000n) {
throw new Error("Too many IPs");
}
10.0.0
Module has been rewritten in Typescript and the type exports have changed, otherwise it's compatible.
9.0.0
All exported functions have been renamed to include a Cidr
suffix:
merge
-> mergeCidr
exclude
-> excludeCidr
expand
-> expandCidr
overlap
-> overlapCidr
contains
-> containsCidr
normalize
-> normalizeCidr
parse
-> parseCidr
8.0.0
- The
single
property has been removed from theparse
result. Usestart === end
instead.
7.0.0
6.0.0
- IPv6 normalization has improved and is now RFC-conform
- Node 16 is now required
5.0.0
Module is now pure ESM and requires Node.js 14.
4.1.0
Node v10 is supported again.
4.0.0
- Add new
cidrTools.contains
function - Node 12.17.0 or greater is now required
3.0.0
- Node 10 is now required (when running on the server)