-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Help with using for CRC-9 (not-byte-sized) #25
Comments
Hi @smarek, generally the CRC output should be configureable on a bit size level. From my point of view at lest the bit sizes Regarding the input data, I see a single byte as the smallest unit which is expected to be feed into the CRC calculation best P.S. happy holidays |
Hi @Nicoretti thank you for reaction, but I think you've missed my point, the CRC-9 is not 9-bit sized just when producing final output, but the input is also not byte sized (135 bits) and i've seen in your code, you assume that the number of operations is Or should I understand it so that if I pad the input with zeroes it should not change the calculation output? Anyway you're not supposed to change anything, I just wanted to get clarification, on whether you think your code should be able to handle odd sized payloads and produce odd sized crc result, or not. Similar project, where eg. CRC-3/CRC-4/CRC-5 and other odd sized calculations are supported by default, is https://sourceforge.net/projects/crccheck/files/ Also wish you nice and pleasant holidays, cheers! |
No wasn't meant that way. I wrote the crc processing/calculation code quite a long time ago. So this must hold true for the input: I thought though the supported output size should be "arbitrary", but not 100% sure without checking in detail. In any case, I have created #26 to track the "arbitrary" bit width issue you pointed out. I must say though, that best |
Status quo should hopefully got clarified in the discussion above, the missing support for all crc widths is tracked in #26 |
To start with, should this library be usable with CRC algorithms that operate on bits instead of bytes (eg. nor data nor result is byte-sized) ?
If so, i'd appreciate help with configuration for CRC-9 per ETSI DMR specification
Page 146, section B.3.10, https://www.etsi.org/deliver/etsi_ts/102300_102399/10236101/02.05.01_60/ts_10236101v020501p.pdf
Polynomial in normal form is 0x59 (bits 9,6,4,3,0 set is 0x259, removing MSB bit then 0x59)
From formula, the CRC result should be inverted, however same document (page 144, section B.3.8 CRC-16-CCITT) shows the inversion polynomial for CRC-16-CCITT, and in your config of the same no inversion is configured ( https://github.com/Nicoretti/crc/blob/master/crc.py#L387 )
I've tried to get it working by using this config, which produces incorrect result
Testing data are for example
This is 135 bits of data, resulting CRC9 should be either 409 or 102
The text was updated successfully, but these errors were encountered: