Class FixedLengthTargetValueMaskUtil
java.lang.Object
dev.blaauwendraad.masker.json.util.FixedLengthTargetValueMaskUtil
Class containing utility methods to set a particular target value length to a fixed size mask. This can be used for
length obfuscation and ignoring escaping characters in string values.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
replaceTargetValueWithFixedLengthAsteriskMask
(MaskingState maskingState, int fixedLength, int targetValueLength) static void
replaceTargetValueWithFixedLengthMask
(MaskingState maskingState, int fixedMaskLength, int targetValueLength, byte maskByte) Replaces a target value (byte slice) with a fixed length string consisting only of the mask bytes inside the input bytes array.
-
Method Details
-
replaceTargetValueWithFixedLengthMask
public static void replaceTargetValueWithFixedLengthMask(MaskingState maskingState, int fixedMaskLength, int targetValueLength, byte maskByte) Replaces a target value (byte slice) with a fixed length string consisting only of the mask bytes inside the input bytes array.- Parameters:
fixedMaskLength
- the length of the fixed-length mask byte string.targetValueLength
- the length of the target value slice.maskByte
- the byte used for each byte in the mask
-
replaceTargetValueWithFixedLengthAsteriskMask
public static void replaceTargetValueWithFixedLengthAsteriskMask(MaskingState maskingState, int fixedLength, int targetValueLength)
-