Skip to content

Credit Card

Based on Extensible Algorithm Framework

The Credit Card algorithm is an instance of the Payment Card Algorithm Framework. The algorithm requires input values to have at least 8 digits in the character group [0-9]. If an input value has less than this, the algorithm will return an error. It preserves the first 6 digits of the input and requires at least one position to be masked for masking to be considered successful. The algorithm masks all subsequent digits by replacing them with a random value. All input characters that are not in the character group [0-9] are preserved. The algorithm maintains Luhn check validity through masking so input values with a valid Luhn check will mask to a value with a valid Luhn check. The out-of-the-box instance of this algorithm is called CreditCard.

For example:

  • "6379315274824970" → "6379318341375224"
  • "6379.3152.7482.4970" → "6379.3183.4137.5224"
  • "abc5473defg04828hijkl0656253" → "abc5473defg04971hijkl6490341"


This algorithm may generate non-conformant data events.