Re: Hashes from composite keys?

From: Daniel Pitts <newsgroup.spamfilter_at_virtualinfinity.net>
Date: Mon, 26 Jul 2010 14:27:33 -0700
Message-ID: <25n3o.103556$Lj2.43090_at_newsfe05.iad>


On 7/23/2010 1:14 PM, Karsten Wutzke wrote:
> Hello,
>
> what are the best practices for generating hash codes from composite
> keys? I need to mimic something like what a composite index does. In
> fact, it's for mapping between relational keys and object IDs.
>
> Can anyone point me into the right direction please?
Yes, don't use Hashing, but use a composite key. Aggregate the keys into one value (eg, the BIT pattern of that one key value is the concatination of the bit patterns of all the other values.)

Hashing is used for very different reasons than you're attempting. Although Bob took the wrong approach in pointing this fact out to you, he was still right in that using Hash is the wrong direction for the task (as you've described it here).

-- 
Daniel Pitts' Tech Blog: <http://virtualinfinity.net/wordpress/>
Received on Mon Jul 26 2010 - 23:27:33 CEST

Original text of this message