Module hashers::oz[][src]

From http://www.cse.yorku.ca/~oz/hash.html.

A comprehensive collection of hash functions, a hash visualiser and some test results [see Mckenzie et al. Selecting a Hashing Algorithm, SP&E 20(2):209-224, Feb 1990] will be available someday. If you just want to have a good hash function, and cannot wait, djb2 is one of the best string hash functions i know. it has excellent distribution and speed on many different sets of keys and table sizes. you are not likely to do better with one of the "well known" functions such as PJW, K&R, etc. Also see tpop pp. 126 for graphing hash functions.

"tpop" is The Practice of Programming. This page shows three classic hashing algorithms.

Structs

DJB2Hasher

Dan Bernstein's famous hashing function.

LoseLoseHasher

A radically bad hash function from the 1st edition of the K&R C book. Do not use; it's horrible.

SDBMHasher

The hash function from SDBM (and gawk?). It might be good for something.

Functions

djb2

Provide access to DJB2Hasher in a single call.

loselose

Provide access to LoseLoseHasher in a single call.

sdbm

Provide access to SDBMHasher in a single call.