Consider I’ve two numbers 1023232 & 44. I want to generate a unique number representing this combination of numbers. How can i generate it?
Requirement
f(x,y) = f(y,x) and f(x,y) is unique for every (x,y) or (y,x)
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if those are two ints, you could just do this:
if you need to generate a truly unique value for two variables of a given size, you need about double the size of each variable. (ok, a bit less now that f(x,y) == f(y,x))
You could also get your original values back by reversing the same operation.