obfuscate
Obfuscates this String by replacing characters at every freq-th position with '*'.
Positions count code points, so a surrogate pair (such as an emoji) is replaced or kept as a whole.
This is a display hint, not redaction: it keeps the string's length and, by default, half of its characters, which is enough to recover a short secret or narrow a guess. Do not use it to keep passwords, tokens or keys out of logs; leave the secret out, or replace it whole, as maskUrlCredentials does for URL credentials.
Return
the obfuscated string
Parameters
freq
the replacement frequency (default every 2nd character, starting at index 0)
Throws
if freq is not positive (it is used as a modulus divisor).