The next function is called
pkphash, after Peter K. Pearson it's inventor. This was published in an article in the Communications of the ACM in 1990.This version of
pkphash gives results in a maximum of 16-bits of hash value. It takes each character of the key and exclusive-ors the ordinal value of it with the value in the `current position' in the pkpnext random walk table to create a new `random' position. The current position in the random table are represented by variables h1 and h2 in the code. At each interation h1 and h2 both move to independent new random position. These two variables are used as two tiny 8-bit integers, the code concatenates them together to create a 16-bit base hash value.