Thanks to Wayne for his work on this. I can help with explaining one thing he spotted:
- Firstly when populating the database I decided that rather than manually
typing in the ISBN numbers I would use an old barcode reader I had lying around to get the ISBN from the barcode number, naturally in true geek fashion getting this to work actually took longer than typing in the ISBN numbers manually, a feat which I ended up doing anyway as curiously the barcode does not seem in include the last digit of the ISBN.
Here's my understanding:
There are many standard systems of barcode. Each one serves a different purpose. The one on the backs of books is like that on many other products. It's called Uniform Product Code and it has an international relation EAN. They are 8 or 13 digit codes which include subcodes for different countries and a check digit. Books are from the country "ISBN" and periodicals from "ISSN" with a different check digit.
To convert to ISBN, remove the country code from the start (I think 978 is ISBN or "Bookland" as some Americans I know call it) and the UPC check digit (the last one). Recalculate the check digit by multiplying the other digits by their positions, so 009942692 is 1*0 + 2*0 + 3*9 + 4*9 + 5*4 + 6*2 + 7*6 + 8*9 + 9*2 = 0 + 0 + 27 + 36 + 20 + 12 + 42 + 72 + 18 = 227 now take 227 mod 11 = 7 and that's the last digit of the ISBN. If it comes out as 10 then it's written as X.
It would be cool to use the distributed free software ISBNsearch for the book lookups, from http://www.isbn.org.uk/ but I've not time to hack it right now.