github.com/iiiceoo/iprange (go): Package iprange parses IPv4/IPv6 addresses from strings in IP range format.  The following IP range formats are supported:  It takes a set of IP range strings, and returns a list of start-end IP address pairs, which can then be automatically extended and normalized, for instance:  When parsing an invalid IP range string, error errInvalidIPRangeFormat will be returned, and dual-stack IP ranges are not allowed because this approach is too complex and confusing. Use the following functions to assert the errors:  Use the interval methods of IPRanges to calculate the union, difference or intersection of two IPRanges. They do not change the original parameters (rr and rs), just calculate, and return the results.  However, do not attempt to perform calculations on two IPRanges with different IP versions, it won't work:  The IPRanges can be converted into multiple net.IP (i.e. IP addresses) or *net.IPNet (i.e. subnets) through their own iterators. Continuously call the method Next() until nil is returned:  Finally, the inspiration for writing this package comes from  both of which are great!
Keywords: go|iprange|ipv4|ipv6