def js_hash(key): hash_value = 1315423911 for i in range(len(key)): hash_value ^= ((hash_value << 5) + ord(key[i]) + (hash_value >> 2)) return hash_value