Crate djb2

Crate djb2 

Source
Expand description

This algorithm (k=33) was first reported by dan bernstein many years ago (1991) in comp.lang.c. another version of this algorithm (now favored by bernstein) uses xor: hash(i) = hash(i - 1) * 33 ^ str[i]; the magic of number 33 (why it works better than many other constants, prime or not) has never been adequately explained.

https://www.cse.yorku.ca/~oz/hash.html

Functionsยง

hash
Generate a 32 bit hash
hash_with_initial
Generate a 32 bit hash (using a custom initial state)