
Check digit algorithms (a.k.a. Modulus Numbering or Mod numbering) are used in conventional and bar code numbering to increase read or scan reliability. This eliminates well over 99% of errors. In applications requiring very high data integrity a check digit is recommended. A check digit is derived mathematically from the data content of a character field, usually a numeric field. The check digit is appended to the data, and the entire message is printed as one numeric field. The scanner uses the same mathematical formula to evaluate the code, and the result is compared with the printed check digit. If the comparison fails, an error has occurred, and the scan is invalidated.
There are a number of check digit methods. Methods have improved from the modulus 9 to the modulus 7 and 11. Weighted modulus systems are even more sophisticated. The weighted modulus check digit supports each of the numbering methods. Since the check digit number is generated by a complex algorithm, which each serial number must go through before the check digit is determined, only digital imaging systems can be employed to calculate the weighted check digit.
There are a number of ways digital fields are manipulated in order to determine check digit algorithms.
1. The modulus number divides the digital field. This is typical
of binary modulus numbering:
The field (2575097) is divided by the modulus number (11):
2575097/11 = 234099 with a remainder of 8. The check digit is 8.
2. The digits in the field are summed, after which the sum
is divided by the modulus number. While simplified as summing the digits
in the field, this method actually weights each digit by the factor
of one, after which the products are summed.
Sum the digits in the field 2575097: (2x1)+(5x1)+(7x1)+(5x1)+(0x1)+(9x1)+(7x1)=37
Divide the sum by modulus number (9): 37/9=4 with a remainder of 1. The check
digit is 1.
3. The digits in the field are weighted, after which the sum
of the products (or sometimes the sum of the digits of the products)
is divided by the modulus number.
Example: The number 2575097 is the field and the number 10 is the modulus
number. Weighting methods include weighting odd digits by one factor
and even digits by another factor. Odd digits are determined by their
position in the numeric field. The first digit position is the least
significant digit (usually the furthest right digit in the field). We
will weight our example by multiplying the odd digits by 3 and
the even digits by 1.
(2x3)+(5x1)+(7x3)+(5x1)+(0x3)+(9x1)+(7x3)
=
6 + 5 + 21 + 5 + 0 + 9 + 21 = 67
67/10 = with a remainder of 7. The check digit is 7.
Once the remainder is determined, it is used to locate the check
digit within a predetermined index. There are two check digit indexes
commonly used, descending (i.e. 0123456789) and ascending (i.e. 0987654321).
Simply put, a descending index results in check digits being the same
number as the remainder. This is referred to as DIVIDE REMAINDER (DR).
An ascending index results in check digits equal to the MOD number
less the remainder. This method is referred to as DIVIDE SUBTRACT
REMAINDER (DSR).
TYPES OF CHECK DIGIT ALGORITHMS:
Three types of check digit algorithms are available: binary, character
weighted, and special. Usually, the digital field is numeric. For numeric
fields, binary and character weighted algorithms are utilized. When alphanumeric
fields are used, special algorithms are required.
binary algorithms:
Binary algorithms are for numeric fields only. The modulus number divides
the numeric value of the field and the remainder (the fraction of the
whole number) is used to determine the check digit. Pointil Systems has
MOD 7 DSR, MOD 11 DR, and MOD 11 DSR.
| Example: MOD 7 DSR Unweighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 7 |
| Field divided by the Modulus number is | 2575097/7 = 367871.0 |
| The remainder is | 0 |
| 7-0 = | 7 |
| Index is | 76543210 |
| Printed field with check digit is | 25750977 |
| Example: MOD 11 DSR Unweighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 11 |
| Field divided by the Modulus number is | 2575097/11 = 234099.7 |
| The remainder is | 7 |
| 11-7 = | 4 |
| Index is | x987654321 |
| Check digit is | 4 |
| Printed field with check digit is | 25750974 |
weighted algorithms:
Weighted algorithms are used for numeric fields. Each digit in the field
is weighted before determining the check digit. There are a number of
weighting methods. Once digits in the field are weighted, the products
of each are summed together or the individual digits of the products are
summed together. The modulus number divides the sum and the remainder
is used to determine the check digit from a predetermined index. Pointil
Systems has MOD 7 DR, MOD 9 DSR, MOD 10 DR, MOD 10 DSR, and MOD 11 DSR.
| Example: MOD 7DR Weighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 7 |
| Weighting is | 1111111 |
| Weighted digits | (2x1)+(5x1)+(7x1)+(5x1)+(0x)+(9x1)+(7x1) |
| Add digits in field | 2+5+7+5+0+9+7 = 35 |
| Divide sum of digits by modulus number | 35/7 = 5.0 |
| Remainder is | 0 |
| Index is | 0123456 |
| Check digit is | 0 |
| Printed field with check digit is | 25750970 |
| Example: MOD 9DSR Weighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 9 |
| Weighting is | 1111111 |
| Weighted digits | (2x1)+(5x1)+(7x1)+(5x1)+(0x1)+(9x1)+(7x1) |
| Sum of weighted digits | 2+5+7+5+0+9+7 = 35 |
| Field/modulus number is | 35/9 = 3.8 |
| Remainder is | 8 |
| Modulus number less remainder | 9-8 = 1 |
| Index is | 9876543210 |
| Check digit is | 1 |
| Printed field with check digit is | 25750971 |
| Example: MOD 10DR Weighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 10 |
| Weighting is | 1111111 |
| Weighted digits | (2x1)+(5x1)+(7x1)+(5x1)+(0x1)+(9x1)+(7x1) |
| Sum of weighted digits | 2+5+7+5+0+9+7 = 35 |
| Field/modulus number is | 35/10 = 3.5 |
| Remainder is | 5 |
| Index is | 0123456789 |
| Check digit is | 5 |
| Printed field with check digit is | 25750975 |
| Example: MOD 10DSR Weighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 10 |
| Weighting is | 3131313 |
| Weighted digits | (2x3)+(5x1)+(7x3)+(5x1)+(0x3)+(9x1)+(7x3) |
| Sum of weighted digits | 6+5+21+5+0+9+21 = 67 |
| Field/modulus number is | 67/10 = 6.7 |
| Remainder is | 7 |
| Modulus number less remainder | 10-7 = 3 |
| Index is | 0987654321 |
| Check digit is | 3 |
| Printed field with check digit is | 25750973 |
| Example: MOD 10DR Weighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 10 |
| Weighting is | 2121212 |
| Weighted digits | (2x2)+(5x1)+(7x2)+(5x1)+(0x2)+(9x1)+(7x2) |
| Sum of weighted digits | 4+5+1+4+5+0+9+1+4 = 33 |
| Field/modulus number is | 33/10 = 3.3 |
| Remainder is | 3 |
| Index is | 0123456789 |
| Check digit is | 3 |
| Printed field with check digit is | 25750973 |
| Example: MOD 11DSR Weighted | |
|---|---|
| Field is | 2575097 |
| Modulus number is | 11 |
| Weighting is | 11111111111 |
| Weighted digits | (2x1)+(5x1)+(7x1)+(5x1)+(0x1)+(9x1)+(7x1) |
| Sum of weighted digits | 2+5+7+5+0+9+7= 35 |
| Field/modulus number is | 35/11 = 3.1 |
| Remainder is | 1 |
| Modulus number less remainder | 11-1 = 10 |
| Index is | 0x987654321 |
| Check digit is | x |
| Printed field with check digit is | 2575097x |
special algorithms:
Special algorithms are used for alpha and/or alphanumeric character fields.
Each Character is assigned a numeric equivalent. The numeric equivalents
are weighted and the products are summed. The total is divided by the
modulus to determine the remainder. The remainder is compared to a preassigned
index to determine the check digit. Pointil Systems has MOD 43.
| Example: MOD 43 | ||||
|---|---|---|---|---|
| Field is | POINTIL |
|||
| Weighting is | 11111111111 |
|||
| Character equivalent fields: | ||||
0 = 0 |
C = 12 |
O = 24 |
- = 36 |
|
1 = 1 |
D = 13 |
P = 25 |
. = 37 |
|
2 = 2 |
E = 14 |
Q = 26 |
SPACE = 38 |
|
3 = 3 |
F = 15 |
R = 27 |
$ = 39 |
|
4 = 4 |
G = 16 |
S = 28 |
/ = 40 |
|
5 = 5 |
H = 17 |
T = 29 |
+ = 41 |
|
6 = 6 |
I = 18 |
U = 30 |
% =42 |
|
7 = 7 |
J = 19 |
V = 31 |
||
8 = 8 |
K = 20 |
W = 32 |
||
9 = 9 |
L = 21 |
X = 33 |
||
A = 10 |
M = 22 |
Y = 34 |
||
B = 11 |
N = 23 |
Z = 35 |
||
| Weight digits | P = 25, O = 24, I = 18, N = 23, T = 29, I = 18,
L = 21 |
|||
| Sum weighted digits | 25+24+18+23+29+18+21 = 158 |
|||
| Modulus number is | 43 |
|||
| Field/modulus number is | 158/43 = 3.6 |
|||
| Remainder is | 6 |
|||
| Index is | 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ-. $/+% |
|||
| Check digit is | 6 |
|||
| Printed field with check digit is | POINTIL6 |
|||
|
©Pointil Systems 12807 NE Airport Way Portland, Or 97230 503.257.5097 |