Re: Best way to hash a set of integers?
- From: Ben Pfaff <blp@xxxxxxxxxxxxxxx>
- Date: Tue, 19 Sep 2006 10:56:44 -0700
"Digital Puer" <digital_puer@xxxxxxxxxxx> writes:
However, I'm still looking for info on how to best hash a *set*
of integers; do I add them, XOR them, multiply them, etc. to
get a final key? What are best practices?
That this was what you wanted wasn't clear to me at first. It's
a more interesting question that hashing a single integer.
I would suggest XOR'ing the integers, then using an integer hash
algorithm on the composite value. Of course, whether XOR is the
best function to use depends on properties of the sets. Can you
tell us anything about the sets?
--
"The fact is, technical people are better off not looking at patents. If
you don't know what they cover and where they are, you won't be knowingly
infringing on them. If somebody sues you, you change the algorithm or you
just hire a hit-man to whack the stupid git." --Linus Torvalds
.
- Follow-Ups:
- Re: Best way to hash a set of integers?
- From: Digital Puer
- Re: Best way to hash a set of integers?
- From: Pascal Bourguignon
- Re: Best way to hash a set of integers?
- References:
- Best way to hash a set of integers?
- From: Digital Puer
- Re: Best way to hash a set of integers?
- From: toby
- Re: Best way to hash a set of integers?
- From: Digital Puer
- Best way to hash a set of integers?
- Prev by Date: Re: Best way to hash a set of integers?
- Next by Date: Re: Best way to hash a set of integers?
- Previous by thread: Re: Best way to hash a set of integers?
- Next by thread: Re: Best way to hash a set of integers?
- Index(es):
Relevant Pages
|