
There are many banks over the world which provides 16 digit credit card number , some banks also provides 14 , 15 digit credit card numbers. Lets see how 16 digit credit card number is validated……..
Validation or selection of credit card number is using Luhn algorithm .how Luhn algorithm validates credit card number is as follow.
1) Starting from check digit multiply by 2 to every second digit
2) If multiplication results are 10 &more than ten then subtract 9 from such value.
3) Now new credit card number will form from that new 8 numbers & existing 8 numbers.
4) Add all digit of credit card number.
If addition of all that credit card number is multiple of 10 then such credit card number is valid & if such addition is not multiple of 10 then such number is invalid credit card number.
Eg . Credit card number
4568273002431056
6*2 | |||||||||||||||
Sum of all digits is 63. Therefore above credit card number is not valid.
