The main
function prints hexToAscii(hex_string)
instead of myKey
.
BTW, you'd better to use binascii.unhexlify
instead of hexToAscii
. And you can use hashlib
module to calculate md5.
>>> import hashlib
>>> import binascii
>>> hex_string = '000000013e2a5b71000003a0'
>>> hashlib.md5(binascii.unhexlify(hex_string)).hexdigest()
'6afebf522c531575e96d6814be816c7c'