Question regarding checksuming of a file

Andrew Robert andrew.arobert at gmail.com
Sun May 14 03:43:35 CEST 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