#### 2.4.1.1. Mode 10 and Mode 1010

The checksum algorithm for Mode 10 is to use “Luhn algorithm”:

1. Counting from the check digit, which is the rightmost one, and moving left, double (x 2) the value of every second digit.
2. Sum the digits of the products (eg, 10 ⇒ 1+0 = 1, 14 ⇒ 1+ 4 =5) together with the un-doubled digits from the original number
3. Got the sum, then do: sum Mod 10 = check digit

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

Example1234567Mode 10 Check digit
(1) Append X1234567 X
(2) From rightmost, every second digit × 22 6 10 14
(3) List all22641+061+4
(4) Got SummarySum=2+2+6+4+1+0+6+1+4=26, 26 Mod 10 = 4X = 4
(5)Result12345674

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

##### 2.4.1.1.1. Mode 1010 Example

Table 2.3. Mode 1010 Check Digit Example

Example12345674Mode 1010 Check digit
(1) Append X12345674 X
(2) From rightmost, every second digit × 2 4 8 12 8
(3) List all143851+278
(4) Got SummarySum=1+4+3+8+5+1+2+7+8=39, 39 Mod 10 = 1X = 1
(5)Result123456741