Calculating md5 checksums.

Rajesh Sathyamoorthy rajesh1986 at gmail.com
Sat Mar 4 00:49:57 EST 2006


 <http://effbot.org/librarybook/md5.htm>I tried the script and had to get a
hexdigest to get the value provided

My test:
SimplyMEPIS-3.3.1-1.iso
checksum: 41a19060d3bb37bd596708ba77964491
i got: 41a19060d3bb37bd596708ba77964491

Do people normally provide md5 checksum in a *hexadecimal string?
*Besides that, is the script reliable?

Replies:
Rajesh Sathyamoorthy wrote:
How do you calculate the md5 checksum of a file?
so far  i got this,

import md5
obj = md5.new()
file = open( 'filename',  'rb')
data = text.read()
obj.update(data)
checksum = md5.digest()

Is this correct? Is there anything else i should do before comparing the
checksum with the one provided for the file?

Fredrik Lundh wrote:
the script has some obvious bugs, but nothing you won't discover simply
by running the program...  (did you try that?  what happened?)

Nainto wrote:
Take a look at: http://effbot.org/librarybook/md5.htm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20060304/f9187529/attachment.html>


More information about the Python-list mailing list