-
Notifications
You must be signed in to change notification settings - Fork 13
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
Question about .valid? method #15
Comments
I agree, I think the I'd be very happy to review a PR that uses the Thanks! |
Yes the real validity test would be both checksum and that the range has been issued by ISBN international. Making the methods |
Hi, thanks. I didn't have time to do the research yet. I'll do it soon.
wt., 12 lut 2019 o 10:37 David Aldridge <notifications@github.com>
napisał(a):
… Yes the real validity test would be both checksum and that the range has
been issued by ISBN international. Making the methods #valid_isbn_13? and
#valid_isbn_10?might be helpful.
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#15 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AAmCDhwTVV7qFhi9OHz0uOpnS1rtW-hCks5vMotUgaJpZM4ajy3e>
.
--
Robert Skorupski
|
Hello.
I think the ".valid?" method is not accurate.
as I can see it's only checking simple regexp isbn.match(/^[0-9]{13}$/) and checksum
It doesn't work well for many ISBNs, for example 8830114722800 - it is mark as valid but it is not:
https://isbnsearch.org/search?s=8830114722800
For now I can use workaround:
if lisbn.parts.nil? && lisbn.parts(4).nil?
then it is invalid.
I would like to look around for proper ISBN validation rules, and use it in ".valid?" method. I will do the research.
The text was updated successfully, but these errors were encountered: