The CreditCardIndexGen Generator uses a prefix with an index to calculate and generate a credit card number using the Luhn algorithm.

In This Article

Generator Parameters

The following parameters may be configured for the CreditCardIndexGen Generator. Items with an asterisk* are required. 

  • cardName* - Defines a constant card name or a reference (americanExpress, masterCard, visa 16, discover, etc.). The card name must match what is shown in the parameter description, or the data will not generate correctly. 
  • cardPrefix* - Defines a credit card prefix (e.g., amex: 24, 37; mastercard: 51; visa: 04, etc.).
  • cardIndex* - Defines the index or delta that will be used to calculate the credit card number.

Video Training

The following video can be used to see a quick tutorial on how to use the CreditCardIndexGen Generator: 

Use Case 1 - Generate Mastercard Numbers with Prefix '51'

This example will show how the CreditCardIndexGen Generator can be used to generate only Mastercard credit card numbers with the prefix '51' only. 

Generator Configuration

The following values have been entered for the Generator parameters: 

  • cardName = masterCard
  • cardPrefix = 51
  • cardIndex = references the id Attribute

Sample Output

Use Case 2 - Generate Mastercard Numbers Using Multiple Prefixes

This example will show how to use a Linked Generator to generate Mastercard numbers using multiple prefix values. For this example, these two Generators will be used: 

  • ListGen - Generates the card prefix numbers that will be used to generate the credit card numbers. 
  • CreditCardIndexGen - Generates the credit card number.

ListGen Configuration

The following parameters have been changed: 

  • waitAmount = 3 (will generate each prefix number 3 times and then move to the next one)
  • list = 51, 52, 53, 54 (prefixes that will be generated)

CreditCardIndexGen Configuration 

The following parameters have been changed: 

  • cardName = masterCard
  • cardPrefix = references ListGen Generator (gen1)
  • cardIndex = references id Attribute

Sample Output