| XXXXXXXXXXXXXXX8268 | +---------------------------+ mysql> SELECT mask_pan(’a*Z’); +-----------------+ | mask_pan(’a*Z’) | +-----------------+ | a*Z | +-----------------+ 

• mask_pan_relaxed( str ) 

Masks a payment card Primary Account Number and returns the number with all but the first six and last four digits replaced by ’X’  characters. The first six digits indicate the payment card issuer. 

Arguments: 

• str : The string to mask. The string must be a suitable length for the Primary Account Number, but is not otherwise checked. 

Return value: 

The masked payment number as a string. If the argument is shorter than required, it is returned unchanged. 

Example: 

mysql> SELECT mask_pan_relaxed(gen_rnd_pan()); +---------------------------------+ | mask_pan_relaxed(gen_rnd_pan()) | +---------------------------------+ | 551279XXXXXX3108 | +---------------------------------+ mysql> SELECT mask_pan_relaxed(gen_rnd_pan(19)); +-----------------------------------+ | mask_pan_relaxed(gen_rnd_pan(19)) | +-----------------------------------+ | 462634XXXXXXXXX6739 | +-----------------------------------+ mysql> SELECT mask_pan_relaxed(’a*Z’); +-------------------------+ | mask_pan_relaxed(’a*Z’) | +-------------------------+ | a*Z | +-------------------------+ 

• mask_ssn( str ) 

Masks a US Social Security number and returns the number with all but the last four digits replaced by ’X’  characters. 

Arguments: 

• str : The string to mask. The string must be 11 characters long, but is not otherwise checked. 

Return value: 

The masked Social Security number as a string, or NULL  if the argument is not the correct length. 

Example: 

mysql> SELECT mask_ssn(’909-63-6922’), mask_ssn(’abcdefghijk’); +-------------------------+-------------------------+ 

