I can't seem to find anything on the interwebs on this.
Basically I have a bunch of xml files with a respective md5 file for each
I want to be able to compare each xml with its md5 hash to ensure they have been sent to us correctly.
I have tried running this as a binary file but I don't think it works.
with open(md5_filename,"rb") as file:
for line in file:
binascii.hexlify to get hexa-decimal representation:
>>> import binascii >>> binascii.hexlify(b' \xc0\xff\xae\x91\x1c\tJ\xc5~\xbe\x8d\x93\xad\xf3\x0c') b'20c0ffae911c094ac57ebe8d93adf30c'
and decode it if you want to get string instead of bytes object:
>>> binascii.hexlify(b' \xc0\xff\xae\x91\x1c\tJ\xc5~\xbe\x8d\x93\xad\xf3\x0c').decode() '20c0ffae911c094ac57ebe8d93adf30c'