Re: Hashes from composite keys?

From: Karsten Wutzke <>
Date: Fri, 23 Jul 2010 14:36:04 -0700 (PDT)
Message-ID: <>

On Jul 23, 11:11 pm, Bob Badour <> wrote:
> Karsten Wutzke wrote:
> > On 23 Jul., 22:14, 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?
> >>Karsten
> > Maybe I wasn't clear enough. I'm not trying to program anything in
> > databases. It's for an object-oriented application to match object
> > identity (hash codes) with composite key values.
> You were plenty clear. You just have no sincere appreciation or desire
> for the right direction.

What in your opinion am I supposed to think given your original response? That you have a sincere desire in showing me the right direction? Out of the door, yes...

That's the sometimes arrogant kind of attitude when I sometimes regret having asked for help on Usenet. I'm looking for a direction, some kind of known algorithms, something that's probably better than what I spontaneously came up with: stringize, then zero-fill, and concatenate strings, integers, booleans, dates etc. and then finally release a hashing function onto that string.

In any case, that idea is already more robust than the XORing, at least with low PK values.

Karsten Received on Fri Jul 23 2010 - 23:36:04 CEST

Original text of this message