NIB check digit
Each one of the 19 digits has a weight:
Digits \((x_{i})\) | \(x_{1}\) | \(x_{2}\) | \(x_{3}\) | \(x_{4}\) | \(x_{5}\) | \(x_{6}\) | \(x_{7}\) | \(x_{8}\) | \(x_{9}\) | \(x_{10}\) | \(x_{11}\) | \(x_{12}\) | \(x_{13}\) | \(x_{14}\) | \(x_{15}\) | \(x_{16}\) | \(x_{17}\) | \(x_{18}\) | \(x_{19}\) |
Weights \((p_{i})\) | 73 | 17 | 89 | 38 | 62 | 45 | 53 | 15 | 50 | 5 | 49 | 34 | 81 | 76 | 27 | 90 | 9 | 30 | 3 |
Now multiply each digit by its weight and add everything. Let \(S\) be that sum.
\[S=\overset{19}{\underset{i=1}{\sum}}p_{i}.x_{i}=p_{1}.x_{1}+p_{2}.x_{2}+...+p_{19}.x_{19}\]Then compute the number \(a\) such that \[0\leq a\leq96\] and \[S= a\,(\mbox{mod }97).\]
The check digit is the number \(98-a\).
The two digits in this number are the check digits of NIB (when this number is smaller than 10, put a zero on the left; for example, \(4\) is replaced by \(04\)).
Note that we are using a Modular Arithmetic.