How can I get the start and end for v4 and v6 ip addresses of a CIDR? I don't care about addresses which are between.
I have checked the net
library and parseCIDR does not return this information. Is there an idiomatic way to calculate the ip range of a CIDR which will work for v6 and v4 addresses alike?
For example, given the CIDR 2001:db8:a0b:12f0::1/32
I would expect
2001:0db8:0000:0000:0000:0000:0000:0000
and 2001:0db8:ffff:ffff:ffff:ffff:ffff:ffff
returned as the start and end addresses respectively.