Package Hilbert is designed to allow consumers to find the Hilbert distance on the Hilbert curve if given a 2 dimensional coordinate. This could be useful for hashing or constructing a Hilbert R-Tree. Algorithm taken from here:
This expects coordinates in the range [0, 0] to [MaxInt32, MaxInt32]. Using negative values for x and y will have undefinied behavior.
Benchmarks: BenchmarkEncode-8 10000000 181 ns/op BenchmarkDecode-8 10000000 191 ns/op
Decode will decode the provided Hilbert distance into a corresponding x and y value, respectively.