Credit Card Validation (Luhn Algorithm)


/ Published in: ASP
Save to your folder(s)

Uses the Luhn formula to quickly validate a credit card. Basically all the digits except for the last one are summed together and the output is a single digit (0 to 9). This digit is compared with the last digit ensure a proper credit card number is entered (Does not actually confirm that is is a real number, just that it is likely to be one. Example: Entering "4000-0000-0000-0002" will pass the check, but "4000-0000-0000-0003" will not pass.)

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.