Upcoming SlideShare
×

# Validation of a credit card number

674 views

Published on

Validation of a credit card number

Published in: Education
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
• Be the first to comment

• Be the first to like this

Views
Total views
674
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
0
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Validation of a credit card number

1. 1. Validation of a CreditCard NumberCome see how it works :D !Gabriel
2. 2. More about the MOD 10 algorithm• The MOD 10 algorithm is a checksum (detection of errors) formulawhich is the common name for the Luhn algorithm.Wikipedia article about this subject pretty much covers theessential about it.• This formula has been in use to validate a lot of identificationnumbers besides credit cards since its development by scientistHans Peter Luhn from IBM.To teach you how to manually validate a specific number, letsdo an example:Gabriel
3. 3. Check this out !• Say we have 38520000023237and we want to check if it could be a real credit card number.• Take the last digit <7>. This is our check digit.• Take the rest of the sequence 3852000002323Double every other digit starting from the right <6,8,10,2,0,0,0,0,0,2,6,2,6>• Sum the digits of the products (e.g. 10 = 1 + 0 = 1)• Add all the digits together: <6+8+1+2+0+0+0+0+0+2+6+2+6 = 33>• Multiply the result by 9: <33 * 9 = 297>Gabriel
4. 4. Kind of Magic !• 297• Take the last digit of the result <7>.If this matches the check digit we have a valid sequence !• Since our check digit (7) matches our result (7), we conclude thatthis sequence would be a valid credit card number!Gabriel