Hash Function Summary
Goals of a hash function
- reproducible mapping from key to table entry
- evenly distribute keys across the table
- separate commonly occurring keys (neighboring keys?)
- complete quickly
Hash functions
- h(n) = n % size
- h(n) = string as base 128 number % size
- Multiplication hash: compute percentage through the table
- Universal hash function #1: dot product with random vector
- Universal hash function #2: next pseudo-random number