-
Notifications
You must be signed in to change notification settings - Fork 72
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
CRC Results between two versions appears to be different #29
Comments
Unfortunately older version used code found online without any actual checks. When this module started getting popular I rewrote it based on pycrc tables and all tests now compare values against reference pycrc implementation. In short, it's possible that older version produced results that aren't necessarily compatible with other libraries. I have a note in the readme about it:
Basically, if you are happy with 0.x version, just stick with it. Sorry about the confusion. |
Got it. How did the crc16ccitt() algorithm get validated? That's the one that seems to be at odds with my results. |
Currently all results are validated against pycrc. |
It still feels like there is a defect here. I'm comparing a computed value against a value created by another system and it fails. Every example I've run this against fails the test. I'm still trying to get my hands on the third-party code sample. |
Sorry, I misunderstood you. Are you saying that 3.x version computes values that don't match values generated by other systems? |
That's right. I pointed to the differences in versions because that's how I first noticed the problem (post-upgrade). That probably wasn't the clearest way to communicate. :) The 28th and 29th bytes of the Buffer in the example is the checksum of the first 27 bytes. |
I just added a test case for your values and |
This feels like user error, but the use case is so simple, it appears as a defect.
The following code snippet produces two different results in version 0.2.0 and 3.2.1
0.2.0 Results
Note that this version has a slightly different implementation. the crc16 (line 6) has the following syntax,
crc.buffer.crc16(chunked_buff);
3.2.1 Results
The text was updated successfully, but these errors were encountered: