def dek_hash(key): hash_value = len(key); for i in range(len(key)): hash_value = ((hash_value << 5) ^ (hash_value >> 27)) ^ ord(key[i]) return hash_value