Good Hash Function for Strings?
Let s = s1s2s3s4…s5: choose
- hash(s) = s1 + s2128 + s31282 + s41283 + … + sn128n
Problems:
- hash(“really, really big”) = well… something really, really big
-
- hash(“one thing”) % 128 = hash(“other thing”) % 128
Think of the string as a base 128 number.