The last digit of every bank card number is determined by a mathematical calculation applied to the preceding digits, a mechanism known as the Luhn algorithm. This algorithm was invented by Hans Peter Luhn, a German-born engineer who worked for IBM and became head of the information research division. The Luhn algorithm, patented in 1954 under the title "Computer for Verifying Numbers" as American patent number 2,950,048, was originally described as a small portable mechanical device, not a software. It was granted on August 23, 1960. The algorithm is used to validate a wide range of identification numbers, including bank card numbers, IMEI numbers of mobile phones, French SIRET numbers, and Canadian social security numbers. The process involves starting from the last digit of the number and moving left, doubling every other digit. If the result exceeds 9, 9 is subtracted, and then all the digits are summed. If the total is a multiple of 10, the number passes the Luhn test. This method is simple, relying only on addition, making it suitable for manual or mechanical verification at the time of its creation. The Luhn algorithm is now codified in the international standard ISO/IEC 7812, which frames the numbering of cards issued by financial institutions. It is effective in detecting common human errors, such as single-digit errors and most transpositions between two adjacent digits. However, it cannot detect transpositions of two sequences of digits, such as 09 to 90 or the reverse. This limitation means that in rare cases, a mistake involving two entire blocks can pass through the mathematical check. The algorithm was not designed to prevent fraud, as it is not a cryptographically secure hash function. A fraudster can construct a fake card number that respects the rule of the multiple of 10, as the formula is public and documented in the ISO/IEC 7812 standard. Therefore, real barriers against fraud are provided by other mechanisms, such as visual cryptograms, confidential codes, and two-factor authentication during online payments. The Luhn algorithm is now a universal system, used to validate various identifiers. In France, it is found behind the SIRET numbers of companies, allowing accounting software to instantly detect typing errors without consulting any official register. Only one out of ten numbers has a valid format according to this algorithm, which allows determining the last digit of a bank card from the first fifteen. This ratio allows payment sites to filter common typing errors quickly without contacting the issuing bank. The algorithm experienced an unexpected resurgence of notoriety in 2026 when an old television sequence featuring a verification code suggestion resurfaced online, amusing internet users who saw it as a humorous prefiguration of two-factor authentication, when it actually more closely resembled the principle of the Luhn calculation.