Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/python3
- import hashlib
- def makehash(_dict):
- _string = str(_dict)
- _encode = _string.encode('UTF-8')
- _hash = hashlib.md5()
- _hash.update(_encode)
- return _hash.hexdigest()
- def main():
- _dict1 = {'a':1, 'b':2, 'c':3}
- _dict2 = {'a': 1, 'b': 2, 'c': 3}
- hash1 = makehash(_dict1)
- hash2 = makehash(_dict2)
- if hash1 == hash2:
- print ('gleich')
- print('Ende')
- if __name__ == '__main__':
- main()
- #TODO b'\xb1\n\x8d\xb1d\xe0uA\x05\xb7\xa9\x9b\xe7.?\xe5'
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement