The credit card policies mask a credit card number (CCN) from the following issuers: American Express, Diners Club, Discover, JCB, MasterCard, and VISA. Each policy preserves the first 4 digits of the issuer identifier from the source CCN and masks the remaining 2 digits of the issuer identifier number and the account number based on the source CCN. Each policy also generates a check digit.
A CCN, as defined by ISO 7812, consists of a 6-digit issuer identifier followed by a variable length account number and a single check digit as the final number. The check digit verifies the accuracy of the CCN and is generated by passing the issuer identifier and account numbers through the Luhn algorithm. The maximum length of a CCN is 19 digits.