Re: Hash Function problem



websn...@xxxxxxxxx wrote:
Hugo wrote:
- Which hash function do you suggest me to use ?

For 64 bits? I am not aware of a really good one taylored for 64 bits,
but obviously you can use SHA-2 (or even MD5 or SHA-1 if you don't
actually want security.) You might be able to modify other functions
like RC4.

Actually, if you are daring, you might try the following: Take a look
up Bob Jenkin's function:

http://burtleburtle.net/bob/hash/doobs.html

His inner loop uses a 96 bit internal state. While he only guarantees
avalanching (what he calls "no funnels") from the 32 bits in the c
variable, you could probably do something like running an additional
mix(a,b,c) round, then output (a^b)+c as the other 32 bits, then you
almost certainly retain the avalanching property (you might lose the
bit independence property -- but this is highly unlikely.) The reason
you don't want to just output c is that this would be the equivalent to
adding 12 '\0' characters to the end of your data which might give your
output too much deductive structure that might translate into a
weakness.

My own testing indicates that Bob Jenkin's hash function is basically
the second fastest (on AMD CPU architectures) good 32 bit hash function
that is known to me, so this solution would set a pretty high bar in
terms of performance (it will certainly outperform those cryptographic
based hash functions). Unfortunately, I don't think my function (the
"SuperFastHash" which I've measured to be the fastest known good 32 bit
hash function), or most other good 32 bit hash functions can be
similarly adapted as they typically only use a 32 bit state.

--
Paul Hsieh
http://www.pobox.com/~qed/
http://bstring.sf.net/

.



Relevant Pages

  • Re: Constructing a random permutation on the fly
    ... Find the required length of the user key The MINIMUM length of user key is ... It ensures the hash function behaves like a random number generator. ... Otherwise, if the hash function hit a fixed point it would then output a never ending stream of identical numbers, which is not a behaviour expected of a random number generator. ... The hash function is just a standard hash function that provides the properties you require, such as output size, internal state and/or cryptographic security. ...
    (sci.crypt)
  • structure of hash functions?
    ... Suppose you want to build a hash function out of an internal state s ... and a weak mixing function m. ... has more parallelism. ...
    (sci.crypt)
  • Re: Hash Function problem
    ... the second fastest good 32 bit hash function ... writing a high performance application that is dealing with strings ... The purpose of a hash ...
    (comp.programming)
  • Re: Hash Function problem
    ... the second fastest good 32 bit hash function ... it is meant for high performance applications. ... writing a high performance application that is dealing with strings ...
    (comp.programming)
  • Re: Hash Function problem
    ... My own testing indicates that Bob Jenkin's hash function is basically ... the second fastest (on AMD CPU architectures) good 32 bit hash function ... My recommended string hashing operations simply start at ...
    (comp.programming)