Skip to content
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

GTIN: False results if length not 10 or 12 #71

Closed
harens opened this issue Jun 18, 2021 · 0 comments
Closed

GTIN: False results if length not 10 or 12 #71

harens opened this issue Jun 18, 2021 · 0 comments
Labels
bug Something isn't working Priority

Comments

@harens
Copy link
Owner

harens commented Jun 18, 2021

If the length of a GTIN code isn't 10, currently, checkdigit treats it as if it were 12 digits. This can lead to false results for other lengths.

This is the line in question:

weights = (1, 3) * 6 if isbn else (3, 1) * 6

We always multiply by 6, which assumes the length is 12.

@harens harens added bug Something isn't working Priority labels Jun 18, 2021
@harens harens closed this as completed in 6604dc5 Jun 18, 2021
harens added a commit that referenced this issue Jun 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Priority
Projects
None yet
Development

No branches or pull requests

1 participant