ALERT

[WEBINAR] Building a Business-Driven Data Architecture

Luhn Formula

Definition - What does Luhn Formula mean?

The Luhn formula is a simple checksum formula that is used in the validation of various identification numbers such as credit card numbers, social security numbers, IMEI numbers and many others. The algorithm validates the number against an included check digit in the number itself, usually the last digit. The Luhn formula is now in the public domain and is widely used in various industries and specified in ISO/IEC 7812-1.

The Luhn formula is also known as the Luhn algorithm, modulus 10 algorithm or mod 10 algorithm.

Techopedia explains Luhn Formula

The Luhn Formula was devised by Hans Peter Luhn, an IBM scientist, who filed a patent for the formula in 1954, which was granted in 1960. The formula was not designed to be a cryptographically secure hash function, but rather as a simple way to protect against accidental errors in creating unique identification numbers. Many government agencies and private institutions used the formula for distinguishing valid numbers from mistyped, incorrect or simply fraudulent numbers.

The formula is used to verify a series of numbers by checking that an included check digit is correct. This check digit is usually attached to partial number in order to complete it.

The following process is the generation of the check digit:

  1. Starting from the rightmost digit, double the value of every second digit.
  2. If the resulting product from the first step is above 9, add the two digits (e.g., 5 × 3 = 15, 1 + 5 = 6). If the result is 9 or less, retain the number.
  3. Take the sum of all the digits.
  4. Multiply the sum by 9 and take the "modulo 10" of the sum; the result is the check digit.

Example: Number series 927638965

9

2

7

6

3

8

9

6

5 is the check digit

9

4

7

12

3

16

9

12

9

4

7

3

3

7

9

3

sum = 45; 45 × 9 = 405 (mod 10) = 5

In order to check that the number is valid, simply follow the algorithm excluding the check digit, and if the same result is obtained as the check digit, then the number is valid according to the Luhn formula. However, this algorithm is not very reliable and is only able to detect mostly single-digit errors and transpositions of adjacent numbers, except the transposition of the two-digit sequence 09 to 90. More complicated algorithms like the Verhoeff algorithm and Damm algorithm are able to detect more transcription errors.

Connect with us

Techopedia on Linkedin
Techopedia on Linkedin
Tweat cdn.techopedia.com
"Techopedia" on Twitter


'@Techopedia'
Sign up for Techopedia's Free Newsletter!

Email Newsletter

Join thousands of others with our weekly newsletter

Resources
Free Whitepaper: The Path to Hybrid Cloud
Free Whitepaper: The Path to Hybrid Cloud:
The Path to Hybrid Cloud: Intelligent Bursting To Amazon Web Services & Microsoft Azure
Free E-Book: Public Cloud Guide
Free E-Book: Public Cloud Guide:
This white paper is for leaders of Operations, Engineering, or Infrastructure teams who are creating or executing an IT roadmap.
Free Tool: Virtual Health Monitor
Free Tool: Virtual Health Monitor:
Virtual Health Monitor is a free virtualization monitoring and reporting tool for VMware, Hyper-V, RHEV, and XenServer environments.
Free 30 Day Trial – Turbonomic
Free 30 Day Trial – Turbonomic:
Turbonomic delivers an autonomic platform where virtual and cloud environments self-manage in real-time to assure application performance.