Content deleted Content added
Tag: Reverted |
No edit summary |
||
(4 intermediate revisions by 4 users not shown) | |||
Line 1:
{{Short description|Simple checksum formula}}
{{redirects|Luhn|people named Luhn|Luhn (surname)}}
The '''Luhn algorithm''' or '''Luhn formula''' (creator: [[IBM]] scientist [[Hans Peter Luhn]]), also known as the "[[modular arithmetic|modulus]] 10" or "mod 10" [[algorithm]], is a simple [[check digit]] formula used to validate a variety of identification numbers. {{efn|It is described in [[United States|US]] patent 2950048A, granted on {{date|1960-08-23|DMY}}.<ref name="US2950048A">{{cite patent|title=Computer for Verifying Numbers|country=US|number=2950048A|status=patent|pubdate={{date|1960-08-23|DMY}}|gdate={{date|1960-08-23|DMY}}|invent1=Luhn|inventor1-first=Hans Peter|fdate=1954-01-06|inventorlink=Hans Peter Luhn}}</ref>}}
Line 107:
parity := length mod 2
'''for''' i from 1 to (length - 1) '''do'''
'''if''' i mod 2
sum := sum + cardNumber[i]
'''elseif''' cardNumber[i] > 4 '''then'''
sum := sum + 2 * cardNumber[i] -
'''else'''
sum := sum + 2 * cardNumber[i]
Line 128:
* [[South Africa|South African]] ID numbers
* [[South Africa|South African]] Tax reference numbers
* [[Personal identity number (Sweden)| Swedish
* [[Sweden|Swedish]] Corporate Identity Numbers (OrgNr)
* [[Greece|Greek]] Social Security Numbers (ΑΜΚΑ)
Line 152:
[[Category:1954 introductions]]
[[Category:Articles with example pseudocode]]
|