Calculating md5 checksums.

Nainto Nainto at gmail.com
Sat Mar 4 01:41:32 CET 2006


Take a look at: http://effbot.org/librarybook/md5.htm

Fredrik Lundh wrote:
> 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?
>
> the script has some obvious bugs, but nothing you won't discover simply
> by running the program...  (did you try that?  what happened?)
> 
> </F>




More information about the Python-list mailing list