c++ - How to map two positive integers to a unique integer? -
I need to find an integer given two integers. I have been given two integers x and y. I want to find a function f ... which maps this integer specifically for any other integer z. That is, z = f (x, y)
Here x = 64 bit integer and y = 64 bit integer I want to convert these numbers to z, as it is again a 64 bit integer .
I tried a pair of cantars, but the work of the Cantors pair gives me 'z' which is 128 bits because the multiplication in the Cantors includes in the pairing ceremony I do not want to z as 128 bit Be mapped because modern computers only have a limit of up to 64 bits.
Is there any way? A small collision is acceptable for me.
If you want to do this for the whole series 64 bit integer, then this is impossible.
2 ^ 64 * 2 ^ 64 = 2 ^ 128 are possible inputs for your function, but you have only
2 ^ 64 different Output, which means that at least
2 ^ 64 mapped numbers for the same integer which is a bit more conflagration than
Comments
Post a Comment