0xflotus / valid-gtin

A lightweight validator function for GTINs
MIT License
8 stars 7 forks source link

fail when check-digit is cero #2

Closed onaxon closed 5 years ago

onaxon commented 5 years ago

Very concise code but I think it is incorrect. For example I get FALSE for the GTIN-13 9783030148270, a real ISBN.

The sum is 110.

0 != 10 - (110 % 10)

0xflotus commented 5 years ago

Very concise code but I think it is incorrect. For example I get FALSE for the GTIN-13 9783030148270, a real ISBN.

The sum is 110.

0 != 10 - (110 % 10)

Thank you for the issue. I hope I fixed it with >= v0.0.10. Feel free to test :)