We're updating the issue view to help you get more done.Â

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:

```
1
```

`978-3-598-21536-0`

This is caused by an unhandled edge case in `checkChecksumISBN13` in the following code:

```
1
```

`return 10 - sum % 10 == ( checkSum - '0' );`

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:

```
1
```

`return (10 - sum % 10) % 10 == ( checkSum - '0' );`

Another solution could be an explicit check for `10` which resolves it to `0`.

None

Marko Bekhta

Piet Vandeput

None

None

None

None

None

None

Yes, likely

None

None

None

6.0.13.Final

Major