Class EncodeUtil
- java.lang.Object
-
- hu.icellmobilsoft.coffee.tool.utils.string.EncodeUtil
-
public class EncodeUtil extends Object
Util class for encoding- Since:
- 1.0.0
- Author:
- balazs.joo, Imre Scheffer
-
-
Field Summary
Fields Modifier and Type Field Description static StringALGORITHM_SHA_512"SHA-512" from message digest algorithmsstatic StringALGORITHM_SHA3_512"SHA3-512" from message digest algorithms
-
Constructor Summary
Constructors Constructor Description EncodeUtil()Default constructor, constructs a new object.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static StringbyteToHex(byte[] hash)Format inputbyte[]to HEXStringstatic StringmessageDigest(byte[] input, String algorithm)Encodes inputStringwith specified algorithm.static Stringsha_512(String stringInput)Digest message inputStringwith SHA-512.static Stringsha3_512(String stringInput)Digest message inputStringwith SHA3-512.static StringSha512(String str)Deprecated, for removal: This API element is subject to removal in a future version.usesha_512(String)instead
-
-
-
Field Detail
-
ALGORITHM_SHA_512
public static final String ALGORITHM_SHA_512
"SHA-512" from message digest algorithms- See Also:
- Constant Field Values
-
ALGORITHM_SHA3_512
public static final String ALGORITHM_SHA3_512
"SHA3-512" from message digest algorithms- See Also:
- Constant Field Values
-
-
Method Detail
-
Sha512
@Deprecated(forRemoval=true, since="2.5.0") public static String Sha512(String str)
Deprecated, for removal: This API element is subject to removal in a future version.usesha_512(String)insteadEncodes inputStringwith SHA-512.- Parameters:
str- inputString- Returns:
- encoded
Stringor null if invalid input or encoding error
-
sha_512
public static String sha_512(String stringInput) throws hu.icellmobilsoft.coffee.dto.exception.BaseException
Digest message inputStringwith SHA-512.- Parameters:
stringInput- inputString- Returns:
- Upper case encoded
Stringor null if invalid input or encoding error - Throws:
hu.icellmobilsoft.coffee.dto.exception.BaseException- any exception- Since:
- 2.5.0
-
sha3_512
public static String sha3_512(String stringInput) throws hu.icellmobilsoft.coffee.dto.exception.BaseException
Digest message inputStringwith SHA3-512.- Parameters:
stringInput- inputString- Returns:
- Upper case encoded
Stringor null if invalid input or encoding error - Throws:
hu.icellmobilsoft.coffee.dto.exception.BaseException- any exception- Since:
- 2.5.0
-
messageDigest
public static String messageDigest(byte[] input, String algorithm) throws hu.icellmobilsoft.coffee.dto.exception.BaseException
Encodes inputStringwith specified algorithm.- Parameters:
input- input message to digestalgorithm- one of message digest algorithms- Returns:
- message digest output by algorith
- Throws:
hu.icellmobilsoft.coffee.dto.exception.BaseException- any exception- Since:
- 2.5.0
-
-