Luhn algorithm: Difference between revisions

Content deleted Content added
WINFOSOFT (talk | contribs)
No edit summary
Tags: Reverted Visual edit Mobile edit Mobile web edit
revert - the rule is to double the rightmost digit and every other digit moving leftward, so the original version was correct
Line 31:
|-
! Multipliers
| 2
| 1
| 2
Line 41 ⟶ 40:
| 2
| 1
| 2
|-
!
Line 55:
|-
!
|9 7
| '''14'''
| style="background: #FFA;" | 9'''18'''
|5 9
| '''18'''
| style="background: #FFA;" | 2'''4'''
|9 7
| '''14'''
| style="background: #FFA;" | 3'''6'''
|5 9
| '''18'''
| style="background: #FFA;" | 8'''16'''
| 7
| '''14'''
| style="background: #FFA;" | 1'''2'''
|-
! Sum digits
|5 7
| '''189''' (1+8)
|39
| '''144'''
|87
| '''186'''
|9
| '''147''' (1+6)
|9
|27
| '''142'''
|5
|3
|9
|8
|5
|1
|}
 
The sum of the resulting digits is 5667.
 
The check digit is equal to <math>10 - (5667\operatorname{mod} 10) = 43</math>.
 
This makes the full account number read 7992739871479927398713.
 
=== Example for validating check digit ===
 
# Drop the check digit (last digit) of the number to validate. (e.g. 7992739871479927398713 -> 7992739871)
# Calculate the check digit (see above)
# Compare your result with the original check digit. If both numbers match, the result is valid. (e.g.<math>(givenCheckDigit = calculatedCheckDigit) \Leftrightarrow (isValidCheckDigit)</math>).