BANKING: The numbers on your credit cards are not random! There is a logic behind all credit card numbers.
BANKING: The numbers on your credit cards are not random! There is a logic behind all credit card numbers.
All credit cards follow the Luhn algorithm:
1. Starting from the first digit, double every alternate digit
2. If the multiplication results in a two-digit number, add both its digits together.
3. Add all these numbers and the digits we didn’t double in Step 1
4. The sum should be divisible by 10
Let’s run it on the card in the image: 5412 7512 3412 3456
![broken image](http://custom-images.strikinglycdn.com/res/hrscywv4p/image/upload/c_limit,fl_lossy,h_9000,w_1200,f_auto,q_auto/784839/675094_636368.png)
Step 1: Result (10)422 (14)522 6422 64(10)6
Step 2: Result 1422 5522 6422 6416
Step 3: Result: 54
As the result is not divisible by 10, it is not a valid card number.
This algorithm is not intended to detect fraud, but only for typing errors. It can detect a single digit error and most adjacent digit swaps error.
Try it on your card!