|

A number of different check digit schemes are presented at this site. As a general rule, a check digit scheme's goal is to catch as many errors as possible (link to error tables). At the very least, the goal of scheme should be to catchall single digit and transposition of adjacent digit errors as they account for about 90% of all errors. Many schemes, like the ones used on US Postal money orders and on airline tickets do not even catchall single digit errors. The UPC (Link to UPC page) and IBM scheme catch all single digit errors, but not all transposition of adjacent digit errors.
The ISBN scheme (A link to the ISBN page) does catchall single digit and transposition of adjacent digit errors. However, it does have two drawbacks. To make the scheme work, it introduced a new character, an X, into the identification number as a check digit. In other words, the check digit could be a 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, or X. The other drawback is that the ISBN scheme only works for identification numbers that are of length 10 (have 10 digits in them). At this point, a goal becomes clear: To develop a check digit scheme that at the very least catches all single digit and transposition of adjacent digit errors, only uses the digits 0 through 9 as check digits, and can be used with identification numbers of any length.
In 1969, J. Verhoeff developed a check digit scheme meets this goal and more. It not only catches all single digit and transposition of adjacent digit errors, but all of the error types listed on (link to error tables). It is flexible as it can be used on an identification number of any length.
The Verhoeff Check Digit Scheme
Let a1a2...an-1an be an identification number with check digit an. The check digit an is appended to the number a1a2...an-1an such that the following equation is satisfied
s
n-1(a1)*s
n-2(a2)*...*s
(an-1)*an = 0
s
= (0)(1,4)(2,3)(5,6,7,8,9) and * is the group operation from D10 as presented in the table
below:

Examples:
Valid Number: 3170092
Calculation: s
6(a1)*s
5(a2)*s
4(a3)*s
3(a4)*s
2(a5)*s
(a6)*a7
= s
6(3)*s
5(1)*s
4(7)*s
3(0)*s
2(0)*s
(9)*2
= 3 * 4 * 6 * 0 * 0 * 5 * 2
= (3 * 4) * (6 * 0) * (0 * 5) * 2
= 2 * 6 * 5 * 2
= (2 * 6) * (5 * 2)
= 8 * 8
= 0
Since the calculation results in 0, the number is a valid one.
Invalid Number: 57014
Calculation: s
4(a1)*s
3(a2)*s
2(a3)*s
(a4)*a5
= s
4(5)*s
3(7)*s
2(0)*s
(1)*4
= 9 * 5 * 0 * 4 * 4
= (9 * 5) * (0 * 4) * 4
= 4 * 4 * 4
= (4 * 4) *4
= 0 * 4
= 4
Since the calculation results in a 4, not 0, the number is not valid.
|