The Luhn mod N algorithm is a generalization of the original Luhn algorithm, a check-digit method patented by Hans Peter Luhn in 1960 and long used to validate credit card numbers in base-10 digit strings, extended so that it can validate identification strings drawn from any even-numbered set of N valid characters rather than only decimal digits. It works by mapping each character of the identifier to a numeric code point, performing the check calculation using arithmetic modulo N, and converting the result back into a character from the same valid character set to serve as the check character. This makes it useful wherever a check character is needed to catch errors in an identifier composed of letters, a mix of letters and digits, or any other closed alphabet of N characters with N divisible by two, such as International Securities Identification Numbers; like the original Luhn algorithm, it reliably detects single-character substitution errors and most transposition errors, though it shares the original's blind spot for certain specific transpositions. This description is adapted from Wikipedia contributors under CC BY-SA 4.0; changes were made. https://creativecommons.org/licenses/by-sa/4.0/
Sources
Wikipedia: Luhn mod N algorithm
Reader Challenges (0)
No disputes yet. Spotted an error or a better source? Open the first one.
Sign in to dispute this or suggest a correction.