Modify FORMATLUHN to exclude the first character
search cancel

Modify FORMATLUHN to exclude the first character


Article ID: 188230


Updated On:


CA Test Data Manager (Data Finder / Grid Tools)



I would like to request an enhancement to the FORMATLUHN
function – the option to exclude the first character from being masked, but
include the value in the final calculation.


i.e. if the original value is: 999999999

I would like the masked value to retain the 9, but have the
number validate with the Luhn function: i.e. 996339404


Currently, using the start
position parameter the 8 digits are masked to a Luhn value, but the entire
string is not.

We posted this question to CA TDM communities and Dhaman asked us to submit an request so we can get patch with this enhancement.


Release : 4.9

Component : CA Test Data Manager


The Enhancement US652742, has been delivered in FastDataMasker-, which contains the modified FORMATLUHN function. 

Below are some instructions the developer passed along regarding how the FORMATLUHN function works:

Let’s suppose that we have 1234567890 as our input.
Start from position ⇒ Define the initial position to mask.
Ex.: Start from position = 3, then we have 1297432113, where 12 wasn’t encrypted, 3456789 was encrypted to 9743211, and 0 was calculated as 3 to make the number valid.

Number of Digits to Mask
 ⇒ Define the number of digits to mask.
Ex.: Number of Digits to Mask = 2, then we have 6834567894, where 3456789 will not be encrypted, 12 was encrypted to 68, and 0 was calculated as 4 to make the number valid.
Number of Last Digits to Mask ⇒ Define number of digits will be masked based in the end. The last digit will not be counted.
Ex.: Number of Last Digits to Mask = 2, then we have 1234567431, where 1234567 will not be encrypted, 89 was encrypted to 43, and 0 was calculated as 1 to make the number valid.
Start from position and Number of Digits to Mask can be used together.
If the Start from position or Number of Digits to Mask is defined, the number of Last Digits to mask shouldn’t be provided. In case you make it, the Last Digits to mask will be ignored.

If you are running an older release of Fast Data Masker, and need this enhancement, please open a support case, and request the latest release of Fast Data Masker (version or greater).