If you want to validate a credit card number, here is a Credit Card Validator.
Credit Card issuers refer to the leading six digits on the card as an "bank identification number (BIN)", or "issuer identification number (IIN)". The remaining numbers on the card are referred to as the primary account number (PAN).
Bank card numbers are allocated in accordance with ISO/IEC 7812. IINs and PANS have a certain level of internal structure and share a common numbering scheme.
The prefix or first digit of the issuer identification number is the MII (major industry identifier). If this digit is 9 the next three digits are the country code from ISO 3166-1. The first digit identifies the industry where the card will be most used in.
Afterwards country code digits comes the account number, digit 7 to last minus one. This is an individual account identifier.
The last digit is the checksum which must pass the Luhn algorithm check to protect against accidental errors.
Online merchants like Amazon Google may use IIN lookups to help validate transactions when you give them a Credit Card number. For example, if the customer's billing address is in on country, while, the credit card's IIN indicates a bank in another country, the transaction may call for extra scrutiny or the transactions will suspend.
ISO/IEC 7812 IINs can be up to 19 digits, are six digits in length,. The structure is as follows:
The Luhn algorithm, also known as the "mod 10" or "modulus 10" algorithm or Luhn formula, is a simple checksum formula used to validate a variety of identification numbers, such as National Provider Identifier numbers, credit card numbers, IMEI numbers in the US, and Canadian Social Insurance Numbers. Most credit cards use the algorithm as a simple method of distinguishing valid numbers, so it was designed to protect against accidental errors, not malicious attacks.
How to pass the following test (form Wikipedia)?