niccokunzmann / crc8

A module with the CRC8 algorithm for Python 2 and 3

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Possibly incorrect implementation of crc8 update

henriksod opened this issue · comments

https://github.com/niccokunzmann/crc8/blob/b6d63e65ca333b67c50f780d1025772e1f3574cc/crc8.py#L133C1-L133C29

In most practical implementations, especially if two nodes communicate with each other and needs to determine the data integrity by matching the given crc with the digested one, you cannot have a history dependent crc since there might be packet loss along the way and the two nodes do not share clocks.

I propose that a given initial_start is provided to the CRC8 class, as done before. However, it should not keep the sum between updates.

See this cpp implementation for reference

Will reopen a new one with a better solution