The MSI barcode, which also goes by the name of the Modified Plessey barcode is mainly used for inventory control in places such as warehouses.
This barcode format can encode any number of digits, and is ended by a checksum digit.
The checksum digit can be calculated using one of several methods.
Using the Modulo 10 method, moving through the string in reverse, you double the value of every second digit, starting at the rightmost digit, and then add the digits together. We then take a modulo 10 of this number, subtract it from 10. This then gives the checksum digit.
For the Modulo 11 method, you need to reverse the digit string first, and then apply a weighting to each digit. There are two ways to work out the weighting. The IBM method assigns a weighting of 2, 3, 4, 5, 6, 7 to successive digits, whereas the NCR method assigns a weighting of 2, 3, 4, 5, 6, 7, 8, 9 to each successive digit. Then, taking the weighted sum, the parity is found by taking the modulo 11 of this sum, and subtracting from 11.
The remaining two methods, Modulo 1011 and Modulo 1110, first applies the one method and then the other.
Now that we have the full string with the parity digit, we can encode.
The left guard of the barcode is 110 and the right guard 1001.
There is only one encoding per digit, which makes encoding rather easy.