Check digit
A check digit is the simplest form of a checksum . The check digit of a multi-digit number is calculated from the remaining digits according to a certain calculation rule . Input errors can be detected by calculating and comparing the check digit.
If the check digit can have ten values, a random match occurs even with invalid numbers with a 10% probability. If two check digits are used, this error probability is only 1%.
Check digits can be used both with manual input via the keyboard and with automatic data acquisition , e.g. B. OCR or barcode readers can be used. In a data acquisition device , the entry can be rejected if the check digit is different.
Example: Deutsche Post identity code
The check digit calculation is carried out when the identity code of the Deutsche Post in modulo -11-method
Code : 4 7 3 1 2 4 8 2 Gewichtung : 8 6 4 2 3 5 9 7 Produkte : 32 42 12 2 6 20 72 14 Summe : 200 Modulo 11 : 200 / 11 = 18 Rest 2 Prüfziffer : Differenz zu 11 = 11 - 2 = 9 Ausnahmen : Wenn Differenz zu 11 = 10: Prüfziffer wird zu 0 Wenn Differenz zu 11 = 11: Prüfziffer wird zu 5
Calculation of the check digit:
- From left to right, the digits are weighted with 8, 6, 4, 2, 3, 5, 9 and 7. In contrast to a simple summation of the code digits, interchanges of two digits can also be recognized.
- The individual code and weighting digits are multiplied and the products are then added.
- The sum is calculated modulo 11, i.e. only the remainder of the division by 11 (i.e. only one digit) is taken into account. Residual formation can also take place immediately after product formation.
- The check digit is the difference between the remainder and 11 (see above for exceptions).
Calculation of the identity code in a formula using Excel as an example :
- The eight-digit code is in cell A1
- formula
=A1&TEIL("012345678905";12-REST(TEIL(A1;1;1)*8+TEIL(A1;2;1)*6+TEIL(A1;3;1)*4+TEIL(A1;4;1)*2+TEIL(A1;5;1)*3+TEIL(A1;6;1)*5+TEIL(A1;7;1)*9+TEIL(A1;8;1)*7;11);1)
Further examples
- International bank account number (IBAN)
- EAN codes in the consumer goods sector
- International Standard Book Number (ISBN) for the book trade
- ISSN for magazines
- Identity card numbers
- Driver's license number
- Institutional identifier (IK) for health care providers
- International securities identification number (ISIN) for the identification of securities
- German pension insurance number
- Euro banknotes , serial number with check digit
- Classification scheme of the Deutsche Bahn AG
- Pharmaceutical central number
- Tax identification number
- Tax account number
- Luhn algorithm
- Air waybill
- Person identification number
- ORCID iD
- Market Location Identification Number
See also
Notes and individual evidence
- ↑ Technical specification of additional letter services. (PDF, 554 kB) p. 8 , accessed on March 4, 2015 .
- ↑ Other weightings are used in other methods for calculating checksums, for example the sequence 10, 9, 8, 7, 6, 5, 4, 3, 2 for ISBN.
- ↑ Structure of the ORCID Identifier (ORCID, accessed June 26, 2017)