Computing Atlas

How Computing Was Built
Sign In
Text size
100%
Theme
Algorithm

Luhn Algorithm

Numerical Algorithm

The Luhn algorithm is a simple checksum formula used to validate a variety of identification numbers, including credit card numbers and government identifiers. It was developed by IBM scientist Hans Peter Luhn and patented on August 23, 1960; the formula is now in the public domain. The algorithm works by removing the existing check digit, doubling every second digit from right to left (subtracting 9 from any result over 9), summing all the resulting digits, and choosing a check digit that makes the total divisible by 10. Because it is designed to catch accidental transcription errors rather than deliberate fraud, it is best understood as an error-detection tool for people keying in numbers rather than a security measure. This description is adapted from Wikipedia contributors under CC BY-SA 4.0; changes were made. https://creativecommons.org/licenses/by-sa/4.0/

Facts
Time Complexity
Time Complexity (category)
Linear Time -- O(n) 1
Connections

In Field

Source Wikipedia: Luhn algorithm
Sources
1. Luhn Algorithm (Wikipedia)
Wikipedia infobox: time complexity linear
Quote, Wikipedia infobox: time complexity linear
linear
View the Source
Wikipedia: Luhn algorithm
  • Lead section
    The Luhn algorithm or Luhn formula (creator: IBM scientist Hans Peter Luhn), also known as the "modulus 10" or "mod 10" algorithm, is a simple check digit formula used to validate a variety of identification numbers.
  • In Field: Algorithms and Complexity Theory, Lead
    The Luhn algorithm or Luhn formula (creator: IBM scientist Hans Peter Luhn), also known as the "modulus 10" or "mod 10" algorithm, is a simple check digit formula used to validate a variety of identification numbers.
View the Source
Wikidata: Luhn Algorithm
Wikidata Q915402, class allow-list match (w-wdresolver-0926)View the Source
Comments (0)
No comments yet. Be the first to share a thought.
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.