def fnv_hash(key): fnv_prime = 0x811C9DC5 hash_value = 0 for i in range(len(key)): hash_value *= fnv_prime hash_value ^= ord(key[i]) return hash_value