bang-olufsen / yahdlc

yahdlc - Yet Another HDLC implementation
MIT License
83 stars 27 forks source link

FCS16 isn't crc16-ccitt #10

Closed Informatic closed 6 years ago

Informatic commented 6 years ago

Hey! Just a quick note for people struggling with similar issue: fcs16.c implements CRC16 with 0x1021 polynomial, but it is reflected, which makes it "X-25" according to https://pycrc.org/.

Informatic commented 6 years ago

also, this can be calculated in python using crcmod library configured like that: crcmod.mkCrcFun(0x11021, 0x0000, True, 0xffff) (or crcmod.predefined.mkCrcFun('x-25')).

Leaving this here for future reference, algorithm properties could be noted down in fcs16.c.