Constructs a RegexMaskingTransformer with given patterns and an optional hash function. Validates the provided patterns to ensure they conform to the expected structure.
An object containing masking patterns. Each pattern should include
a regular expression (regex
) and optionally a replacement
string
or a mask
function.
Optional
hashFunction: HashFunctionAn optional custom hash function to be used for masking.
Rehydrates a masked message back to its original form using the provided state.
The masked message to be rehydrated.
The state map containing mappings of masked values to their original values.
The rehydrated (original) message.
Masks content in a message based on the defined patterns.
The message to be masked.
The current state containing original values.
A tuple of the masked message and the updated state.
RegexMaskingTransformer class for masking and rehydrating messages with Regex.