def sdbm_hash(key): hash_value = 0 for i in range(len(key)): hash_value = ord(key[i]) + (hash_value << 6) + (hash_value << 16) - hash_value; return hash_value