Skip to content

2.0.0

Compare
Choose a tag to compare
@c-robinson c-robinson released this 27 Dec 06:37
· 12 commits to main since this release

v1.0.8...v2.0.0

This release introduces a breaking change for IPv6 functions that take or return an integer value, including the Hostmask and Net6 structs and methods. Previously these functions relied upon *big.Int to hold the v6 address space, but this has been replaced by lukechampine.com/uint128. The performance improvement for the affected functions is so significant (from 5x faster for the increment/decrement functions to a whopping 25x faster for DeltaIP6()) that it easily justifies the incompatibility. IPv4 functions are unaffected by this change.

It has always been a goal for this library to not rely on dependencies outside of the Go standard library and hopefully some future v3 of this library could employ an internal uint128 type but that would require the adoption of this proposal or something similar.

TLDR:

  • all functions requiring or returning *big.Int have been rewritten to take uint128.Uint128 instead
  • new conversion functions have been created to move between IPv6 and uint128.Uint128 (the *big.Int converters still remain)
  • Net6 and Hostmask now also take and use uint128.Uint128
  • benchmarks, tests, examples and documentation have all been updated to reflect the change
  • the top of the README temporarily calls the change out for added visibility
  • added functions to convert ARPA DNS entries back to net.IP because, weirdly, I need to do this