CD_MOD10_LUHN Function


Description: This function corrects a MOD10 LUHN check digit. The check digit is applied to the source string and both the source string and check digit are passed to the function. This check digit is used to validate credit card numbers that can be from 13 to 16 digits long. The function takes as input a string containing a number ending with a potentially invalid check digit. It returns a string containing the number ending with a correct check digit according to the MOD10 LUHN algorithm. The MOD10 check does not offer security, instead, it offers error detection.

Parameters: String

  • Source text: The source string value

Return: Entire string with check digit applied

Syntax:CD_MOD10_LUHN (<source text>)

Example: Generate the check digit for the Account number.

DE("Account number").setValue
  (CD_MOD10_LUHN( DE("Account number").getOriginalValue( ) ) )

{{export-indexterm primary="CD_MOD10_LUHN function"/}}

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*