dlpx-core: CM Digits

Based >Extensible Algorithm Framework

The CM Digits algorithm is an instance of the Character Mapping Algorithm Framework.

This algorithm masks all ASCII digits (0–9) within any input string. Non-digit characters (letters, punctuation, symbols) are preserved exactly as they appear in the input. CM Digits can therefore be applied to purely numeric or alphanumeric values (for example, strings containing both text and digits). Refer to the framework description for details of how masking is performed.

Be aware that this algorithm can produce value collisions when applied to Numeric data types. This is because leading zeros are not significant in numeric types, so while "7" → "8" and "304" → "008" may be different string results, when inserted into a numeric field, they represent the same value. If this behavior is undesirable, consider using the CM Numeric algorithm.

This algorithm may generate Non-Conformant Data warnings in the following cases:

  • No digits are found in the input (for example, "ABCxyz").

    This algorithm may trigger a non-conformant warning if the masking job is configured for numeric-only input.
  • The input format or data type does not match the job configuration (for example, the job expects numeric input, but receives a string).

For example:

  • "6379315274824970" → "8345698341375224"

  • "99" → "05"

  • "ABCxyz123" → "ABCxyz391" (Only digits are masked; letters remain unchanged. Depending on configuration, this may generate a Non-Conformant Data warning if the masking job expects numeric input only.)

  • "0" → "6"

Choosing between CM Digits and CM Numeric

  • CM Digits: masks digits in any string, tolerant of letters/symbols.

  • CM Numeric: intended for numeric data types; masking still occurs in alphanumeric input but always triggers a non-conformant warning.

    CM Digits is best for text fields containing numbers (e.g., account codes, IDs), while CM Numeric is best for numeric database columns.