Crcmod python3 polynomial error
问题 I need to use a crc checksum in a python3 program, but my knowledge of crc is virtually non-existent. Here is the test code I wrote import crcmod crc_func = crcmod.mkCrcFun(0x1d, initCrc=0x07, xorOut=0x00) print(hex(crc_func(b'123456789'))) When I run this, I get the following error: ValueError: The degree of the polynomial must be 8, 16, 24, 32 or 64 But 1D is 8 bit, so I must be doing something wrong. Please explain what I did wrong. 回答1: But 1D is 8 bit No it isn't; it's 5 bits: >>> bin