The substitution digits, that is, the results of the double and reduce procedure, were not produced mechanically. The device took the mod 10 sum by mechanical means. The algorithm appeared in a United States Patent for a simple, hand-held, mechanical device for computing the checksum. Therefore, systems that pad to a specific number of digits (by converting 1234 to 0001234 for instance) can perform Luhn validation before or after the padding and achieve the same result. The Luhn mod N algorithm is an extension that supports non-numerical strings.īecause the algorithm operates on the digits in a right-to-left manner and zero digits affect the result only if they cause shift in position, zero-padding the beginning of a string of numbers does not affect the calculation. Other, more complex check-digit algorithms (such as the Verhoeff algorithm and the Damm algorithm) can detect more transcription errors. It will detect most of the possible twin errors (it will not detect 22 ↔ 55, 33 ↔ 66 or 44 ↔ 77). It will not, however, detect transposition of the two-digit sequence 09 to 90 (or vice versa). The Luhn algorithm will detect all single-digit errors, as well as almost all transpositions of adjacent digits.
0 Comments
Leave a Reply. |