Skip to content

๐Ÿ”’ Obfuscate Transformer โ€‹

The Obfuscate transformer is used to obfuscate or mask string values by replacing characters with a specified symbol.

๐Ÿ” Alternation โ€‹

This transformer mutates the existing row value by partially replacing characters.

โœ… Valid Data Types โ€‹

  • String

โš™๏ธ Options โ€‹

OptionTypeDescriptionDefault
symbolStringThe character to use for obfuscation.*
start-atIntegerThe 0-based index where obfuscation starts.3
stop-atIntegerThe 0-based index where obfuscation stops.None (to end of string)

๐Ÿงช Examples โ€‹

Example 1: Default behavior โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = "obfuscate"
Input:  "Obfuscation example"
Output: "Obf****************"

Example 2: Specifying symbol โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = { obfuscate = { symbol = "?" } }
Input:  "Obfuscation example"
Output: "Obf????????????????"

Example 3: Specifying start-at โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = { obfuscate = { start-at = 10 } }
Input:  "Obfuscation example"
Output: "Obfuscatio*********"

Example 4: Specifying stop-at โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = { obfuscate = { stop-at = 10 } }
Input:  "Obfuscation example"
Output: "Obf*******n example"

Example 5: Specifying all options โ€‹

toml
[[table.columns]]
name = "column-example"
transformer = { obfuscate = { start-at = 15, stop-at = 26, symbol = "~" } }
Input:  "Only obfuscate transformer text"
Output: "Only obfuscate ~~~~~~~~~~~ text"

๐Ÿช„ Alias Support โ€‹

You can also use the alias redact:

toml
[[table.columns]]
name = "column-example"
transformer = "redact"