maskXifyFront.php
Table of Contents
Functions
- maskXifyFront() : mixed
- Masks the front of each word with `x`, keeping a few trailing characters.
Functions
maskXifyFront()
Masks the front of each word with `x`, keeping a few trailing characters.
maskXifyFront(mixed $value[, int $unmaskedLength = 2 ][, bool $hash = false ][, int $seed = 0 ]) : mixed
Implements the conventional xifyFront masker. Within each word (a run of
alphanumeric, _ or - characters) every character except the last
unmaskedLength ones is replaced by x; words no longer than
unmaskedLength are left untouched. Every other character (spaces,
punctuation) becomes a blank. Non-string values (boolean, number) become the
fixed string "xxxx", and null stays null.
Parameters
- $value : mixed
-
The original value.
- $unmaskedLength : int = 2
-
How many trailing characters of each word to keep.
- $hash : bool = false
-
Append a short hash to reduce collisions.
- $seed : int = 0
-
Secret used by the hash (0 = unseeded).
Tags
Return values
mixed —The masked string, "xxxx" for non-strings, or null.