I have a class whose instances have two atributes each with an integer. I want to create a __hash__
method for it and my first choice was using the Cantor pairing function:
cantor(x, y) = 0.5 * (x + y) * (x + y + 1) + y
that returns an unique integer given two unique integers. But the only problem with this is it starts returning really large numbers very fast and I was wondering if there's a better way to do it.