A hash function for hash tables must have these two properties
- Homogeneity All outputs H () should be evenly distributed as much as possible. In other words, for a 32-bit hash function, the probability of each output should be 1/2 ^ 32. (for n-bits, this should be 1/2 ^ n). With a uniform hash function, the probability of collision is minimized to a minimum for any possible input.
- Low computational costs It is assumed that the hash functions for the tables will be FAST compared to cryptographic hash functions, where the rate is traded for resistance to the inverse image (for example, it is difficult to find a message from a given value of the hash function) and collision resistance.
For hash tables, all cryptographic functions have a BAD choice, since the computational cost is huge. Since hashing is used here not for security, but for quick access. MurmurHash is considered one of the fastest and most uniform features suitable for large hash tables or hash indexes. For small tables, the trivial hash function should be fine. A trivial hash is where we mix the values โโof an object (by multiplying, adding and subtracting with some simple).
Andreas Bakurov
source share