Skip to main content

Transform

Goal

Use transform to parse the values created by the anonymization rule. The transform is a java function that takes the output of the format string as input, and processes them before storing the results to the database.

The difference between a convert and a transform is that a convert is done on an input source and a transform is done on the output of the anonymization rule, i.e., the output of the format string.

Use cases for transform

Use transform to ensure that the generated anonymized data follows business specific structural rules.

Ano Structure and Examples

...
<rule> <column>
format %s
transform <transformation>
<input-source>
...
  • Passes the value of %s to the <transformation> function. The result is then stored database.

Built-in transformation functions

Email

The Email built-in transformation function does the following to the format string output:

  • Letters are lowercased: A-Z->a-z
  • Numbers and lowercased letters are unchanged
  • Some country specific letters are replaced:
    • æ->ae
    • ø->oe
    • Ã¥->aa
  • Some symbols are replaced by a dot:
    • (whitespace) ->.
    • -->.
    • _->.
    • ..->.
  • All other characters are removed
  • Checks if string contains @:
    • if not, then append @mail.com to the end of the string.
    • if last character, then append mail.com to the end of the string.
    • else, nothing is appended.

CreditCard

The CreditCard built-in transformation function uses the Luhn algorithm for Credit Card encoding. It replaces the last digit for MOD10 checksum validation.

  • The format string must be digits for the transform to work, e.g., "1234567890123456".

Custom Transformations

If you want to write your own transformation, see Custom Transformations for details.