发布时间:2019-09-06 08:59:50编辑:auto阅读(2341)
python crc32有两种校验.第一种是assii码校验第二种是16进制校验.
import binascii
#https://www.cnblogs.com/kerndev/p/5537379.html
#https://stackoverflow.com/questions/5557214/crc32-checksum-in-python-with-hex-input
def crc32asii(v):
return '0x%8x' % (binascii.crc32(v) & 0xffffffff)
def crc2hex(crc):
return '%08x' % (binascii.crc32(binascii.a2b_hex(crc)) & 0xffffffff)
s='1234567890'
b = bytes(s, encoding='utf-8')
print(crc32asii(b))
#1234567890的16进制为499602D2
d='499602D2'
print(crc2hex(d))
上一篇: cocos2dx[3.x]——V3.x各
下一篇: python 执行系统命令(curl)
47863
46424
37314
34759
29331
25990
24945
19966
19563
18050
5806°
6433°
5946°
5975°
7079°
5925°
5963°
6456°
6417°
7798°