Credit Card Numbers Logic
Credit
card numbers are not random and they follow a standard logic. Card
number contains information about card issuer as well as card holder
and also it contains a check digit that validates the complete card
number.
The
very first number is the Major Industry Identifier (MII) and
indicates type of card issuing institution. For instance,
- 1 and 2 are issued by airlines.
- 3 is issued by travel and entertainment.
- 4 and 5 are issued by banking and financial institutions.
- 6 is issued by merchandising and banking.
- 7 is issued by petroleum companies.
- 8 is issued by telecommunications companies.
- 9 is issued by national assignment.
The
first six digits are the Issuer Identification Number (IIN).
These can be used to look up where the card originated from. Check
list
of popular IINs on
Wikipedia for more details. Popular ones are
- Visa: 4*****
- American Express (AMEX): 34**** or 37****
- Diner’s Club International: 36****
- Mastercard: 51**** to 55****
The
seventh digit to the second-to-last digit is the customer account
number.
Most companies use just 9 digits for the account numbers, but it’s
possible to use up to 12.
The
very last digit of each credit card is the check digit, or checksum.
It is used to validate the credit card number using the Luhn
algorithm.
The Luhn Algorithm Validation Check
The Luhn
Algorithm is
used to validate all sorts of numbers, including credit cards, IMEI
numbers and some social security numbers. It is not foolproof, but is
generally considered to be useful.
Take
the credit card number and read the digits from the right. Double
every other number and write them down – if you do it in the same
order as your card is written it will help with clarity. Now,
wherever you have calculated a double-digit number, change it so that
it reads as “first digit + second digit” (in other
words, sum the digits of the products). Finally, take your
calculations and add those numbers to the numbers remaining on your
card that you didn’t double. A legitimate credit card number will
give you a result that is divisible by 10.
For
instance, let’s use a number: 4012 8888 8888 1881.
Card
no.
|
4
|
0
|
1
|
2
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
8
|
1
|
8
|
8
|
1
|
|
Double
every 2nd digit from right
|
8
|
|
2
|
|
16
|
|
16
|
|
16
|
|
16
|
|
2
|
|
16
|
|
|
Sum
of digits
|
8
|
0
|
2
|
2
|
7
|
8
|
7
|
8
|
7
|
8
|
7
|
8
|
2
|
8
|
7
|
1
|
90
|
90
result is divisible by 10.
No comments:
Post a Comment