|compute_hash (state, key, keylen, vector)||Call the correct hash function depending on what was used.|
|local hash_djb2 (key, len)||These hash functions are all from the cmph sources, where they can be found in the xxx_hash.c files.|
|local hash_fnv (key, len)||See http://www.isthe.com/chongo/tech/comp/fnv/.|
|local hash_jenkins (k, length, initval, vector)||Calculate the hash value using the Jenkins algorithm.|
- compute_hash (state, key, keylen, vector)
Call the correct hash function depending on what was used.
- vector: (optional) A memory area where to store the internal state of the hash function, i.e. three 32 bit words. Any one of them can be used as a hash value, preferably vector.
- local hash_djb2 (key, len)
These hash functions are all from the cmph sources, where they can be found in the xxx_hash.c files. In version 0.8, only hash_jenkins remains. Note that cmph version has an xor operation instead of the addition (a change supposedly favored by Dan Bernstein, the author of this algorithm).
- local hash_fnv (key, len)
See http://www.isthe.com/chongo/tech/comp/fnv/. The algorithm included in cmph-0.6 is therefore "FNV-0", which is obsolete; it doesn't have a non-zero initialization for "hash".
- local hash_jenkins (k, length, initval, vector)
Calculate the hash value using the Jenkins algorithm.
- k: key string
- length: length of the key
- initval: previous hash, or an arbitrary value
- vector: place to store the internal state variables a, b, c
Return value:the hash value In file: src/hash/hash-functions.c line 175