def tab_hash(key): hash = 0 i = 0 for c in key: c_int = ord(c) hash_partial = hmap[c_int] ^ (c_int << i) hash ^= hash_partial i += 1 # print(f"{c} : {hash_partial} : {hash}") # i+= hmap[i & 0xFF] return hash