GeneralHashFunctions_9.py 139 B

12345
  1. def bp_hash(key):
  2. hash_value = 0
  3. for i in range(len(key)):
  4. hash_value = hash_value << 7 ^ ord(key[i])
  5. return hash_value