Reference Link
In addition, This article also mentions the case of a Dos attack using a hash collision: http://www.cnblogs.com/charlesblc/p/5990475.html
The core of the DJB algorithm is to compute the hash value by multiplying the hash value (Key) by 33 (that is, by moving the 5 bits to the left, plus the hash Value)
Zend Hashtable's hashing algorithm is exceptionally simple: HashKey = key & ntablemask;
In general terms, as long as the 16 bits are guaranteed to be 0, then the hash value after the mask is located is all colliding at position 0.
An addition hash
The so-called additive hash is the addition of the input elements of a single sum to form the final Result.
Static int int
{
int hash, i;
for (hash = key.length (), i = 0; i < key.length (); I++)
Hash + = Key.charat (i);
Return
}
The prime in this case is any prime number, and it can be seen that the value of the result is [0,prime-1].
Two-Bit arithmetic Hash
This type of hash function fully mixes the input elements by taking advantage of the various bitwise operations (common is SHIFT and xor). For example, the standard spin hash is constructed as Follows:
Static int int Prime) { int hash, i; for (hash=key.length (), i=0; i<key.length (); + +I ) = (hash<<4) ^ (hash>>28) ^Key.charat (i); return (hash% prime);}
Collision treatment, One is open hashing, also known as Zipper method, The other is closed hashing, also known as Open address law.
"Todo" Common hashing hash algorithm