|
Check Digit Calculation
Introduction and Use
The check digit
table provides the information needed to calculate check digits using Dual
Mod 10, Arithmetic Mod 10, Arithmetic Mod 11, Geometric Mod 11 and
Geometric Mod 10 algorithms.
Number your
existing OCR scan line, for all characters to be included in the check
digit calculation, from left to right starting with number “one”.
|
Corresponding
Number
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
|
Scan
Line
|
4
|
8
|
7
|
2
|
1
|
5
|
8
|
3
|
7
|
Match each
corresponding number, from left to right, with a number in the column
titled “Field digits left to right” on the Check Digit Calculation
Weight Table.
Select the
algorithm that you wish to use to calculate your check digit.
Go to the corresponding column for your selected check digit
algorithm. Under each of the
corresponding number positions on the OCR scan line (column titled
“Field digits left to right”) write the number in the corresponding
row as it appears under the column of your selected check digit algorithm.
| Dual
Mod 10 |
|
Corresponding
Number
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
|
Scan
Line
|
4
|
8
|
7
|
2
|
1
|
5
|
8
|
3
|
7
|
|
Weight
|
2
|
1
|
2
|
1
|
2
|
1
|
2
|
1
|
2
|
For example:
If you have selected Dual Mod 10 you will place a 2 under the left
most character to be used in the calculation of the check digit.
Under the second character or the character to the immediate right
of the first character place a 1. Continue
until a weight value has been placed under each character to be used in
the calculation of the check digit.
Multiple the
weight value times the value of the character immediately above it in the
scan line.
Add the sum of
all the products of the multiplication.
Divide the sum of
the products by the number of the value of your check digit.
For a Mod 10 divide your product by 10.
For a Mod 11 divide your product by 11.
Carry your division only to the ones place.
Determine the remainder if any.
Example:
The product sum is 112.
-
Dual
Mod 10 = 112 / 10 = 11 Remainder 2
-
Arithmetic
Mod 10 = 112 / 10 = 11 Remainder 2
-
Arithmetic
Mod 11 = 112 / 11 = 10 Remainder 2
-
Geometric Mod
11 = 112/ 11 = 10 Remainder 2
-
Geometric Mod
10 = 112 / 10 = 11 Remainder 2
If the product
sum is 110
-
Dual
Mod 10 = 110 / 10 = 11 Remainder 0
-
Arithmetic
Mod 10 = 110 / 10 = 11 Remainder 0
-
Arithmetic
Mod 11 = 110 / 11 = 10 Remainder 0
-
Geometric Mod
11 = 110/ 11 = 10 Remainder 0
-
Geometric Mod
10 = 110 / 10 = 11 Remainder 0
Using the
Remainder Table find your remainder under the column titled
“Remainder”.
Move to the right
on the row where you found your remainder until you are under the column
of the check digit algorithm that you used.
The character
found at the intersection of the row and column is the check digit for the
characters that you included in your check digit routine.
Example: You want
to calculate an Arithmetic Mod 11 check digit for the following series of
numbers: 32174215
|
Number 1
|
3
|
2
|
1
|
7
|
4
|
2
|
1
|
5
|
|
Sequence
2
|
1
|
2
|
3
|
4
|
5
|
6
|
7
|
8
|
|
Weight 3
|
2
|
3
|
4
|
5
|
6
|
7
|
2
|
3
|
|
Product
4
|
6
|
6
|
4
|
35
|
24
|
14
|
2
|
15
|
|
Sum 5
|
6
|
12
|
16
|
51
|
75
|
89
|
91
|
106
|
1These
numbers are the digits in the scan line.
You will be calculating a ninth digit that will be added to the
right of the last digit.
This ninth digit will be the check digit.
2The
sequence number is the location of the scan line digit within the scan
line. The
sequence number is used to reference the weight value from the Check Digit
Calculation Weight Table.
3This
number is retrieved from the Check Digit Calculation Weight Table.
The weight digit corresponds to the intersection of the row
representing Sequence and the column representing the selected check digit
routine (Arithmetic Mod 11 in this example).
4This
number is the product of Number 1
times Weight 3.
5This
is the running sum of the results in the Product 4
line. The
final sum is the number that will be used in calculation of the check
digit.
-
Divide the
sum 106 by 11. 106
/ 11 = 9 Remainder 7.
-
Using the
Remainder Table look under the column titled Remainder.
Find the number 7.
-
Now move
across the row where the 7 is located on to the column titled
Arithmetic Mod 11. The
number in this location (4) is the Arithmetic Mod 11check digit for
the string of numbers 32174215.
|