I'm trying to create a unique unsigned "long" number ($64$ bits) from a list of $4$ other numerical values. Some function $f(n_1, n_2, n_3, n_4) = x$. The order of the values is important so unfortunately I can't use this technique (calculating unique value from given numbers) which seems to give the same unique value from a set of numbers where order doesn't matter.
For example $n_1 = 10, n_2 = 14, n_3 = 18, n_4 = 21$ should be different than $m_1 = 10, m_2 = 1, m_3 = 418, m_4 = 19$. In addition, $o_1 = 10, o_2 = 14, o_3 = 21, o_4 = 18$ should also be different.
I realize it might not be possible to get a truly unique number due to the 64-bit limitation but if you can help me to find a number that's very unlikely to be unique, that would be very very nice:)
Other interesting suggestions that I've looked at:
Deduce a unique number from number
Calculate unique Integer representing a pair of integers
Perhaps that last one could be applied three times? Since $4$ values are two pairs, each pair could generate a unique value and then the two unique values could be used in the function again?
The first rule of hash functions is that you probably shouldn't be designing hash functions on your own (most people design pretty bad ones).
A simple way is to take a string hash function, put the numbers in with separators, and then hash the string, like "n1,n2,n3,n4". The programming language you're using may have a built in hash function for this purpose (for example, Java has a hash function for strings built in, which you can use [or reimplement - I don't think Java requires the hash functions to be consistent on different runs of the program] but it is 32 bits). Obviously a 32 bit hash function can be mapped to 64 bits by ignoring 32 bits. Or, you can concatenate 32-bit hashes for "n1,n2" and "n3,n4" into a 64 bit long.
A list of hash functions on wikipedia may be useful.
Do you have any restrictions on what values the numbers can take?