pycrc icon indicating copy to clipboard operation
pycrc copied to clipboard

Add support for residue values

Open rawr51919 opened this issue 5 years ago • 2 comments

In http://reveng.sourceforge.net/crc-catalogue/, the CRCs described within utilize a residue value as part of their calculations. In the case of CRC8 (or at least the implementation pycrc uses), it uses a residue value of 0x00, however other CRC algorithms use different residue values. Do you think that residue values can be reasonably implemented into pycrc, @tpircher?

rawr51919 avatar Apr 03 '19 17:04 rawr51919

I think the residue value is a side product of the calculation, not an init value. In what scenario is this value useful? Is there a use case where this value is used in practice?

tpircher-zz avatar Apr 04 '19 16:04 tpircher-zz

It is used for CRC verification: when the device runs the message+CRC through the CRC algorithm again, it'll see a final value of residue if there were no transmission errors. https://stackoverflow.com/a/242164/2404492

Since pycrc is used simply for CRC calculation, it is unclear whether the support of residue should be added to pycrc. The way I currently see it implies that the CRC verification is left to the user.

me21 avatar Nov 15 '21 10:11 me21