On Wikipedia, the description of the Luhn algorithm is very easily understood. Then the number is valid according to the Luhn formula else it is If the total modulo 10 is equal to 0 (if the total ends in zero).Together with the undoubled digits from the original number. Left, double the value of every second digit. Counting from the check digit, which is the rightmost, and moving.I read about the Luhn algorithm on Wikipedia: I am trying to implement simple validation of credit card numbers.