GeneralHashFunctions_10.py 182 B

1234567
  1. def fnv_hash(key):
  2. fnv_prime = 0x811C9DC5
  3. hash_value = 0
  4. for i in range(len(key)):
  5. hash_value *= fnv_prime
  6. hash_value ^= ord(key[i])
  7. return hash_value