Question regarding checksuming of a file

Andrew Robert andrew.arobert at gmail.com
Sat May 13 21:43:35 EDT 2006


Actually, I think I got it but would like to confirm this looks right.

        import md5
        checksum = md5.new()
        mfn = open(self.file_name, 'r')
        for line in mfn.readlines():
            checksum.update(line)
        mfn.close()
        cs = checksum.hexdigest()
	print cs

The value cs should contain the MD5 checksum or did I miss something?

Any help you can provide would be greatly appreciated.

Thanks



More information about the Python-list mailing list