import binascii class Hash: def crc32(self,data): rs = binascii.crc32(data) #unsigned 32-bit CRC rs = rs % (1<<32) return rs