Saturday, 14 September 2013

Python: Strange output when calculate md5

Python: Strange output when calculate md5

When i calculate MD5 for a file in Python i get a strange output. My
function :
def md5_for_file(self, fname, block_size=2**20):
f = open(fname)
data = f.read()
m = md5.new()
if len(data)>0:
m.update(data)
f.close()
return m.digest()
Output :

I need to convert that to utf8 or what?!

No comments:

Post a Comment