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

For ISBN13 calculate and validate, when the checksum is 0 returned value is X instead #171

Closed
mohsenBanan opened this issue Mar 31, 2023 · 3 comments

Comments

@mohsenBanan
Copy link

bookUtils.cs -i isbnCalculate13 978-1-960957-03
Returns X --- instead of 0

bookUtils.cs -i isbnValidate13 978-1-960957-03-X --- Returns True
bookUtils.cs -i isbnValidate13 978-1-960957-03-0 --- Returns False

978-1-960957-03-0 is a valid ISBN13.

Returning X instead of 0 seems to be by design, but why?

If it is not by design, then it is a bug.

P.S. bookUtils.cs is just a python command service that uses checkdigit.isbn

@harens harens closed this as completed in 3a6d184 Apr 9, 2023
@harens
Copy link
Owner

harens commented Apr 9, 2023

Hey @mohsenBanan 👋

Thanks for using checkdigit and for opening this issue! You're completely right that this is a bug (ISBN-13 shouldn't produce X as a check digit). I've pushed a commit that should fix this and I'll publish a new release shortly.

Thanks again for the bug report and for using checkdigit.

@harens
Copy link
Owner

harens commented Apr 9, 2023

@all-contributors please add @mohsenBanan for bug.

@allcontributors
Copy link
Contributor

@harens

I've put up a pull request to add @mohsenBanan! 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants