The hack in this post makes use of Luhn’s algorithm which was developed by Hans Peter Luhn who was awarded US Patent 2950048 (“Computer for Verifying Numbers”) for the technique in 1960. In Practice, Using the Luhn’s algorithm, the last digit of the credit card number is arrived at. The same algorithm can be used to check if a number is actually a valid credit card number.
Credit card numbers are usually of 16 digits, however, they may go upto 19 digits. In order to verify if a number is a valid credit card number, follow the steps below.
In order to arrive at the answer using Luhn’s Algorithm, we will need a 4 row table with number of column’s equal to the number of credit card digits ( most probably 16 or more in special cases)
1.) Write the credit card number in the first row. Lets take the example as 5189 3691 3883 7916 as a credit card number which needs to be verified as a correct number.
2.) In the second row of the table, alternatively multiply the digit by 2.
5 1 8 9 3 6 9 1 3 8 8 3 7 9 1 6 5 x 2 = 10 1 8 x 2 = 16 9 3 x 2 = 6 6 9 x 2 = 18 1 3 x 2 = 6 8 8 x 2 = 16 3 7 x 2 = 14 9 1 x 2 = 2 6 10-9=1 1 16-9=7 9 6 6 18-9=9 1 6 8 16 – 9 = 7 3 14 – 9 = 5 9 2 6 1 1 7 9 6 6 9 1 6 8 7 3 5 9 2 6 3.) In the third row, force all digits to be less than 10, by subtracting 9 where necessary.
4.) Enter the digits obtained after the subtraction in fourth row.
5.) Add up all the digits in fourth row. If the end result is divisible by 10, the number is a valid credit card number. In our case, we got 86, which is not divisible by 10 and hence 5189 3691 3883 7916 is not a valid credit card number.
If you are willing to learn more about how credit card numbers are formed and what is the significance of each digit, i would suggest that you go through this article.
You can follow me on Twitter at http://twitter.com/vaibhav1981
Do stay tuned to Technofriends for more, one of the best ways of doing so is by subscribing to our feeds. You can subscribe to Technofriends feed by clicking here.
Follow me on Twitter at @vaibhav1981 Tagged with: Algorithm, Credit Card Number, Credit Card Numbers, Digits, End Result, Hack, How-To, Number Credit Card, Patent, Subtraction, Tutorial, Valid Credit Card, Valid Credit Card Number

Pingback: Correll Round Activity Table | banquet tables
Pingback: Kids Computer Desk-Kool Kolor Collection | banquet tables
Pingback: BagOfNothing.com » Bag of Randomness
Pingback: links for 2009-02-12 | Yostivanich.com
Pingback: Best posts on Technofriends from 9th February - 15th February 2009 | Technofriends
Pingback: Correll Melamine Adjustable Height Folding Table | banquet tables