Table 2.1. MSI Barcode Format
Format | start character | Any number of digits | Checksum digit(s) | A stop character |
---|---|---|---|---|
Explanation | a wide bar followed by a narrow space | Digits | 5 modes:
|
narrow bar, a wide space, then a narrow bar |
Digits/Bits | Bit: 1 | Digits: XXX... | Digit(s): X/XX | Bits: 00 |
The MSI barcode uses one of five possible schemes for calculating a check digit:
The checksum algorithm for Mode 10 is to use “Luhn algorithm”:
Assume an example of an account number "1234567" that will have a check digit added, making it of the form “1234567X”:
Then the steps to calculate the X are:
Table 2.2. Mode 10 Check Digit Example
Example | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mode 10 Check digit |
---|---|---|---|---|---|---|---|---|
(1) Append X | 1 | 2 | 3 | 4 | 5 | 6 | 7 | X |
(2) From rightmost, every second digit × 2 | 2 | 6 | 10 | 14 | ||||
(3) List all | 2 | 2 | 6 | 4 | 1+0 | 6 | 1+4 | |
(4) Got Summary | Sum=2+2+6+4+1+0+6+1+4=26, 26 Mod 10 = 4 | X = 4 | ||||||
(5)Result | 12345674 |
For the second checksum digit, the calculation method is still the same, just take the “12345674” as the input number, the calculate the X for “12345674X”
To calculate the Modulo 11 check digit, use the following process:
Assume an example of an account number "1234567" that will have a mode 11 check digit added, making it of the form “1234567X”:
Table 2.4. Mode 11 Check Digit Example
Example | 1 | 2 | 3 | 4 | 5 | 6 | 7 | Mode 11 Check digit |
---|---|---|---|---|---|---|---|---|
(1) Add weight | 2 | 7 | 6 | 5 | 4 | 3 | 2 | X |
(2) digit × weight | 2 | 14 | 18 | 20 | 20 | 18 | 14 | |
(3)add all, get sum | Sum=2+14+18+20+20+18+14=106, 106 Mod 11 = 4 | X = 4 | ||||||
(4)Result | 12345674 |
And for the mode 1110, take “1234567”as example, just to use the mode 11 for “1234567”to calculate the first mode 11 check digit, is 4, then do mode 10 for “12345674”then calculate out the second mode 10 check digit, is 1, so the whole result is “123456741”
Tip | |
---|---|
While most MSI barcodes include at least one checksum digit, so in many case, the printed MSI barcode does not show out the first checksum digit, while only show the second checksum digit if exists. |