Note: NEW dependency on python-ctype --- cfv.py 2007-02-02 22:25:48.000000000 +0100 +++ cfv.py 2008-04-21 16:15:23.000000000 +0200 @@ -17,7 +17,7 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -import getopt, re, os, sys, errno, time, copy, struct, codecs +import getopt, re, os, sys, errno, time, copy, struct, codecs, ctypes from stat import * cftypes={} @@ -698,11 +698,12 @@ class CRC32: digest_size = 4 def __init__(self, s=''): - self.value = _crc32(s) + self.value = ctypes.c_uint32(0); + self.value.value = _crc32(s) def update(self, s): - self.value = _crc32(s, self.value) + self.value.value = _crc32(s, self.value.value) def digest(self): - return struct.pack('>I',self.value) + return struct.pack('>I',self.value.value) def _getfilemd5(file): return _getfilechecksum(file, md5.new)