Class FixedLengthTargetValueMaskUtil

java.lang.Object
dev.blaauwendraad.masker.json.util.FixedLengthTargetValueMaskUtil

public final class FixedLengthTargetValueMaskUtil extends Object
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 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)