I am using python to do make a download manager to verify md5 checksums automatically... The thing is python gives a wrong md5, I cross-checked with a third party md5 verifier software.
I am using hashlib to check md5.. here's my piece of code for md5 checksum For some files, it gets md5 right but for others its just completely wrong...
x= sys.path[0]
x= x + '\\' + file_name
print 'file successfully saved to path', x
file_ref=open(x,'rb').read()
hashlib.md5(file_ref).hexdigest()
print 'MD5 of file is:',hashlib.md5(file_ref).hexdigest()
md5 for original file on website: e557fa76ed485fd10e8476377ad5be95
md5 given by python: cb3b2227733d3344dba15e5e39d04f43
md5 given by md5 verifier: e557fa76ed485fd10e8476377ad5be95
please help :/