Fixed
Details
Assignee
Marko BekhtaMarko BekhtaReporter
Piet VandeputPiet VandeputBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
Marko BekhtaPiet VandeputPull Request
Components
Fix versions
Affects versions
Priority
Major
Details
Details
Assignee
Marko Bekhta
Marko BekhtaReporter
Piet Vandeput
Piet VandeputBug Testcase Reminder (view)
Bug reports should generally be accompanied by a test case!
Bug Testcase Reminder (edit)
Bug reports should generally be accompanied by a test case!
Participants
Marko Bekhta
Piet Vandeput
Pull Request
Components
Fix versions
Affects versions
Priority
Created March 28, 2019 at 12:59 PM
Updated June 13, 2019 at 1:45 PM
Resolved April 9, 2019 at 11:47 AM
ISBN-13 codes ending with a checksum of `0` always fail, even if valid.
Example of a valid ISBN which will get flagged as invalid:
This is caused by an unhandled edge case in `checkChecksumISBN13` in the following code:
The left-hand side of the equation will produce a sum which is checked against the right-hand side checksum. The sum has a possibility of resulting in the number `10` which will fail when checking against the checksum `0`.
The ISBN-13 algorithm however states that a sum of `10` should be converted to a sum of `0` before being compared to the checksum. https://en.wikipedia.org/wiki/International_Standard_Book_Number#ISBN-13_check_digit_calculation
One possible solution could be an additional modulo operation such as:
Another solution could be an explicit check for `10` which resolves it to `0`.