I'm considering a hash function for a tuple of and maximum-valued integers for example (3 ,2, 5 )
-- where each element of the tuple has some maximum value N
.
My plan is to treat the elements of the tuple as the digits of a number in base N
, so that in the trivial case of N = 10
the tuple(3 ,2, 5 )
hashes to 325, or 213 if N = 8
.
(1) Is this hashing technique flawed and (2) If not, does it have a name, and (3) Are there better ways to hash a tuple of integers.
N-1
. In fact, it will work more than fine; there will be zero collisions.