Sanitize()

Detects and masks sensitive information (such as passwords, API keys, tokens, etc.) from a given string. The function identifies patterns commonly used for sensitive data and replaces them with a mask.

Sanitize( text=string, replacement=string );

Returns: String

Argument Description Default
text
string, required

The input string to be sanitized.

Alias: string

replacement
string, optional

The replacement string to use as a mask for sensitive data. If not specified, defaults to "****".

Alias: mask


Examples

input = "User login with password:secretPass123";
    //Default replacement
    writeDump(sanitize(input));
    //With the replacement mask
    writeDump(sanitize(input,"-----"));

See also