| Store | Cart

doing "checksum" in python

From: Irmen de Jong <irme...@xs4all.nl>
Tue, 29 Mar 2005 00:20:25 +0200
GujuBoy wrote:
> is there a built-in function that does a "checksum" on a file...basicly> counts the bytes and computes a 16-bit checksum for each given FILE.> > this is the like the "sum" command in unix> 


Try zlib.adler32 or zlib.crc32 ...?

>>> import zlib>>> zlib.crc32(open("c:\\boot.ini").read())
-1176164168

--Irmen

Recent Messages in this Thread
GujuBoy Mar 28, 2005 11:11 pm
Irmen de Jong Mar 28, 2005 10:20 pm
Sean Blakey Mar 28, 2005 11:27 pm
Messages in this thread