Tuesday, November 07, 2006

convert between 13 digits and 10 digits xisbn

self note.
(a) from 10 digit to 13 digits

if 10 digits takes the format ABCDEFGHIJ, 13 digits is going to be: 978ABCDEFGHI(?), and last digit (checksum) can be calcualted by:

(10-((9*1)+(7*3)+(8*1)+(A*3)+(B*1)+(C*3)+(D*1)...+(I*3)) modulo 10) modulo 10

(b) from 13 digits to 10 digits
if the first three digits is not "978", it cannot be converted to 10 digits.

if the first three digits is "978", takes remaining 9 digits: ABCDEFGHI, and calcuate checksum for 10 digits ISBN:
(11-((A*10)+(B*9)+ .... +(I*2) modulo 11)) modulo 11

10 will be replaced by X

reference:
[1] http://wiki.tcl.tk/12638
[2] http://www.isbn.org/standards/home/isbn/transition.asp

1 Comments:

Anonymous Anonymous said...

This comment has been removed by a blog administrator.

4:48 PM  

Post a Comment

<< Home