[CRC8校验和,带有Python crcmod中的自定义多项式

问题描述 投票:0回答:1

我正在尝试使用crcmod来计算由定制多项式为183(十进制)的微控制器发送的crc校验和。

当我尝试使用时

crc8 = crcmod.Crc(183)

我知道

ValueError: The degree of the polynomial must be 8, 16, 24, 32 or 64

但是

bin(183)

返回

'0b10110111'

表明它是一个8位多项式。

我在做什么错?

python crc
1个回答
0
投票

多项式的阶数必须为8 ...

8位数字是7度。尝试439,即183 + 256(2 ^ 8)。

© www.soinside.com 2019 - 2024. All rights reserved.