GeneralHashFunctions_6.py 178 B

12345
  1. def sdbm_hash(key):
  2. hash_value = 0
  3. for i in range(len(key)):
  4. hash_value = ord(key[i]) + (hash_value << 6) + (hash_value << 16) - hash_value;
  5. return hash_value