From a long ago checkdigit is used in every important sequence of numbers, such as bank account, taxpayer number, etc.
Multiply each number in the sequence of numbers by the value called weight in specified algorithm. Figure out a sum of these numbers, and divide it by specified modulus. Then,
In the process of printing the barcode, bars sometimes get thick or thin illegally. Checkdigit is indispensable to avoid misreading caused by these errors. That is, when the sequence of numbers written in the barcode doesn't match with the checkdigit we had read, the computer refuses the sequence of numbers to input.
Barcode does/doesn't need the checkdigit by its type;
We'll take an example, frequently employed JAN(EAN) barcode (Modulus 10, Weight 3:1) and illustrate the relation of weight, modulus, etc.
sequence | 4 | 9 | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | |
x | x | x | x | x | x | x | x | x | x | x | x | ||
weight | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | 1 | 3 | |
sum | 4 | +27 | +0 | +3 | +2 | +9 | +4 | +15 | +6 | +21 | +8 | +27 | =126 |
126 (sum) / 10 (modulus) = 12, remains 6 | |||||||||||||
10 - 6 (remainder) = 4 (check digit) |
Moreover, dividing directly the sequence of numbers with the modulus, then
There are many type of checkdigit we cannot display here at once.
In detail, see
"Barcode Haya-wakari
(A Quick Guide to a Barcode)".