Luhn algorithm: Difference between revisions

Content deleted Content added
WINFOSOFT (talk | contribs)
Tags: Reverted Mobile edit Mobile web edit
Reverting vandalism
Line 31:
|-
! Multipliers
| 2
| 1
| 2
Line 41 ⟶ 40:
| 2
| 1
| 2
|-
!
Line 55:
|-
!
| 147
| style="background: #FFA;" | '''918'''
| 189
| style="background: #FFA;" | '''34'''
| 147
| style="background: #FFA;" | '''86'''
| 189
| style="background: #FFA;" | '''116'''
| 147
| style="background: #FFA;" | '''2'''
| 14
| style="background: #FFA;" | '''3'''
| 18
| style="background: #FFA;" | '''8'''
| 14
| style="background: #FFA;" | '''1'''
|-
! Sum digits
Line 79:
|}
 
The sum of the resulting digits is 6667.
 
The check digit is equal to <math>10 - (6667\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>).