tab_hash_4.py 210 B

12345678
  1. def bad_hash(key):
  2. hash = 0
  3. for c in key:
  4. c_int = ord(c)
  5. hash_partial = hmap[c_int] ^ c_int
  6. hash ^= hash_partial
  7. # print(f"{c} : {hash_partial} : {hash}")
  8. return hash