tuple hashing functions across languages
This commit is contained in:
committed by
=Michael Hohn
parent
5bdbd60cc5
commit
8590bd6de7
12
experimental/qldb-specification/tuple-hash.py
Normal file
12
experimental/qldb-specification/tuple-hash.py
Normal 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)
|
||||
Reference in New Issue
Block a user