public class Utils extends Object
| Constructor and Description |
|---|
Utils() |
| Modifier and Type | Method and Description |
|---|---|
static String |
escapeNLFChars(String value)
Replace any NLF (newline function) with an underscore to prevent log injection attacks.
|
static boolean |
isEmpty(String value)
Determines if a string is null or empty
|
static String |
replaceCRLFWithUnderscore(String value)
Replace any carriage returns and line feeds with an underscore to prevent log injection attacks.
|
static String |
toSHA(byte[] input)
Converts an input byte array to a SHA hash.
|
static String |
toSHA(String input)
Converts an input String to a SHA hash.
|
public static String toSHA(String input)
input - The string to hashpublic static String toSHA(byte[] input)
input - Byte array to hashpublic static boolean isEmpty(String value)
value - string to testtrue if the string is empty or null;
false otherwisepublic static String replaceCRLFWithUnderscore(String value)
value - string to convertpublic static String escapeNLFChars(String value)
value - string to convertCopyright © 2021. All rights reserved.