tuple hashing functions across languages

This commit is contained in:
Michael Hohn
2025-05-14 10:38:17 -07:00
committed by =Michael Hohn
parent 5bdbd60cc5
commit 8590bd6de7
4 changed files with 71 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
import hashlib
import json
atl_L = [(1, "s1"), (2, "str")]
sl_hash = []
for item in atl_L:
encoded = json.dumps(item, separators=(',', ':')).encode("utf-8")
md5sum = hashlib.md5(encoded).hexdigest()
sl_hash.append(md5sum)
print(sl_hash)