maskRandomString.php
Table of Contents
Functions
- maskRandomString() : mixed
- Replaces a string value with a random anonymized string.
Functions
maskRandomString()
Replaces a string value with a random anonymized string.
maskRandomString(mixed $value) : mixed
Implements the conventional randomString masker: only string values are
modified — any other type (number, boolean, null) is returned unchanged.
The replacement keeps the original length (with a minimum of 1).
The replacement is random, not a reversible hash of the input — the goal is anonymization, not byte-compatibility with any external tool.
Parameters
- $value : mixed
-
The original value.
Tags
Return values
mixed —The masked string, or the value unchanged when not a string.