After carrying out steps 1 (doubling every second digit from the right and subtracting 9 if result is > 9) and 2 (summing all digits, this time including the check digit), you can determine if the number is Luhn valid as follows: The process of verifying if a credit card number is valid according to the Luhn algorith is simple. Verifying a card number with a Luhn checksum The units digit (3) is the check digit.Compute the sum of the non-check digits (67).
GENERATE VALIDATE MASTERCARD CREDIT CARD NUMBERS GENERATOR MOD
For our example, the equation is 67 × 9 mod 10. The check digit can be obtained by computing the sum of the non-check digits then computing 9 times that value modulo 10. We still need to calculate the check digit, X. The sum of all the digits in the third row above is 67+x.
In the following example, we use a sample credit card number "7992739871", with an unknown Luhn check digit at the end, displayed as 7992739871x: