| TIP: Click on subject to list as thread! | ANSI |
| echo: | |
|---|---|
| to: | |
| from: | |
| date: | |
| subject: | Isbn Validation? |
Steven Pasztor,
In a message on 7 October, wrote :
sp> Someone must of needed to do this sometime:
sp>
sp> Anyone know how to validate the ISBN numbers from books? I urgently nee
sp> the algorithm for validating an input field in one of my programs, but ca
sp> find it anywhere.
sp>
ISBNs have 10 digits. The first digit indicates language (English
is 0). Next two digits indicate publisher. Next six digits are the book
number assigned by the publisher. The last digit is a weighted checksum
designed to detect any single digit error or any single transposition
error. It is calculated to satisfy
\sum_{i=1}^{10} ix_i \equiv 0 \pmod{11}
where the ISBN is x_1x_2x_3...x_{10}.
So all you have to do to validate an ISBN is take the sum of each digit
multiplied by its position (leftmost is 1 rightmost is 10). If the sum
is 0 modulo 11 (i.e. a multiple of 11) then the ISBN is valid.
(Note that the final digit x_{10} may be 'X' in which case x_{10} = 10).
Source: Raymond HILL, 1986, A First Course in Coding Theory, OUP
ISBN 0-19-853803-0 (try it out :-) )
Regards,
Alex.
...
* ATP/Linux 1.40 *
--- GEcho 1.12/beta+
* Origin: The InterACTive BBS - Canberra ACT - (06) 239-7311 (3:620/243)SEEN-BY: 50/99 620/202 243 250 252 623/630 711/401 409 410 413 430 510 807 SEEN-BY: 711/808 809 932 934 712/515 713/888 714/906 800/1 7877/2809 @PATH: 620/243 711/808 809 934 |
|
| SOURCE: echomail via fidonet.ozzmosis.com | |
Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.