Comment 9 for bug 1559281

Revision history for this message
brian d foy (brian-d-foy) wrote :

I'm the maintainer of the Business::ISBN module. I think there are some easy ways to approach this problem (much of which repeats Josh):

1. Insert the unassigned-yet-used group codes into the group ranges data structure. You then verify the ISBNs as normal and still catch bad group codes. You can do this by making a local version of Business::ISBN::Data, or a new namespace that replaces the global variable that Business::ISBN::Data inserts. This way you still catch bad group codes.

2. The private _checksum method returns the good checksum even for bad ISBNs. I think that is stable enough to be safe for everyday use. It's what fix_checksum uses.

3. The fix_checksum method will give you the checksum it thinks it should be, even if the ISBN is bad. You know what the current checksum is because you know what the ISBN string is. If the ISBN fails because it's a bad group code, and the group code is one that you want to accept, you have the checksums and can decide which one to use.

I don't think it would be in the best interests of most users to nerf the module to allow bad isbns. If there's something you need in the module to make this easier without relaxing the safeguards, I'll look at pull requests.

I don't monitor this place, so if you want my attention say something on the GitHub issue for this: https://github.com/briandfoy/business-isbn/issues/6