1,利用python计算文件crc值
def fileCRC32(file,crc32,buf):
crc32^=0xffffffff
for tmp in buf:
crc32 = crc32_table[(crc32^ord(tmp))&0xff]^((crc32>>8)&0xffffff)
return crc32^0xffffffff
while True:
tmp=frb.read(4*1024)
if tmp=='':
break
crc32 += fileCRC32(os.path.join(root,file),crc32,tmp)