crc32 with wintel files

Kristian Ovaska kristian.ovaska at helsinki.fi
Thu Jul 25 04:46:29 EDT 2002


Chris Hartemink <chart (at) mit.edu>:
>I'm trying  to create crc32 checksums for files, not strings.

When you call file.read(), it returns a string which you can feed to
the crc32 funtion. Remember to open the file in binary 'rb' mode. If
the files get large, you might want to read the file in chunks of
limited size using file.read(CHUNKSIZE). In this case, you pass the
so-far-computed checksum to crc32 as the second argument.

-- 
Kristian Ovaska <kristian.ovaska at helsinki.fi>



More information about the Python-list mailing list