-
-
Notifications
You must be signed in to change notification settings - Fork 124
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
EAN13 calculate_checksum() generates inconsistent values #196
Comments
The issue is that the implementation saves the whole number plus the checksum into |
While this is the "expected behaviour" as per the documentation, it's obviously un-intuitive and can be improved. I'm just not sure how to improve it without breaking existing usages. |
I think that #215 should fix it. Can you confirm? |
Fixed in #213 |
f242961 fixes EAN14 |
When using the EAN13() constructor with a 12 digit argument to create an EAN13, the check digit generated in the constructor is different than if you were to call calculate_checksum() on the 13 digit value returned by the constructor.
gives that the check digit is 0
implying that the check digit is 4
This seems to be due to the fact that when calculate_checksum() is called on a 13 digit EAN via the object itself, the reverse traversal that is used in the method includes the 13th digit when summing and calculating the check digit.
The text was updated successfully, but these errors were encountered: