Skip to content

ISBN13 class for manipulating and and checking validity of ISBN13 numbers

Notifications You must be signed in to change notification settings

eminarium/ISBN13

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

ISBN13

ISBN13 class for manipulating and and checking validity of ISBN13 numbers

Files

The algorithm is:

  1. Take each digit, from left to right and multiply them alternatively by 1 and 3
  2. Sum those numbers
  3. Take mod 10 of the summed figure
  4. Subtract 10 and if the end number is 10, make it 0

Example for 978014300723:

  1. (9×1) + (7×3) + (8×1) + (0×3) + (1×1) + (4×3) + (3×1) + (0×3) + (0×1) + (7×3) + (2×1) + (3×3)
  2. 86
  3. 86 mod 10 = 6
  4. 10 - 6 = 4

Therefore the complete ISBN is: 9780143007234

About

ISBN13 class for manipulating and and checking validity of ISBN13 numbers

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages