Re: Best way to hash a set of integers?



Digital Puer said:

<snip>

I guess I'm looking for a way to compute what could be
called a multi-dimensional key. Suppose I have three integers
representing age, height (in cm), and weight (in lbs).

What a bizarre mix of units! :-)

I want
to somehow combine those together into a single key that will be
my index into a hash table (prior to doing mod hash_table_size).

Have you tried simply adding the numbers? What sort of distribution do you
get?

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
.



Relevant Pages