CRC8 Checksum with custom polynom in Python crcmod

751 Views Asked by At

I'm trying to use crcmod to compute a crc checksum sent by a microcontroller with a custom polynom of 183 (decimal).

When I try to use

crc8 = crcmod.Crc(183)

I get

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

but

bin(183)

returns

'0b10110111'

which shows that IS a 8 bit polynom.

What am I doing wrong?

1

There are 1 best solutions below

2
rcgldr On

The degree of the polynomial must be 8 ...

An 8 bit number is degree 7. Try 439, which is 183 + 256 (2^8).