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 :
output http://img51.imageshack.us/img51/6615/20j7.png
I need to convert that to utf8 or what?!
md5is deprecated. You should usehashlibinstead. docs.python.org/2/library/hashlib.html#module-hashlib