/*-----------------------------------------------------------------*/ /* Let's talk a little about the anatomy of a credit card: */ /* */ /* ------------------------------------------------ */ /* | | */ /* | | */ /* | | */ /* | | */ /* | 5 3 0 4 4 6 4 2 1 2 3 4 5 6 7 8 | */ /* | |____________| |___________________| | | */ /* | | | | Checksum| */ /* | | | Account Identifier | */ /* | | BIN(Bank Identification Number) | */ /* |MII(Major Industry Identifier) | */ /* | | */ /* ------------------------------------------------ */ /* */ /* The first number is Major Industry Identifier (MII), */ /* which tells you what sort of institution issued the card. */ /* */ /* 1 and 2 are issued by the 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. */ /* Here are a few you might recognize: */ /* */ /* Visa: 4***** */ /* American Express (AMEX): 34**** or 37**** */ /* 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. This means */ /* that using the current algorithm for credit cards, the world */ /* can issue about a trillion cards before it has to change the */ /* system. */ /* */ /* The very last digit of a credit card is the check digit or */ /* checksum. It is used to validate the credit card number using */ /* the Luhn algorithm. */ /*-----------------------------------------------------------------*/