Class HashUtil
java.lang.Object
com.mirth.connect.server.userutil.HashUtil
Provides hash utility methods.
-
Method Summary
-
Method Details
-
generate
Takes in any object and generates a SHA-256 hex hash.- Parameters:
data- The data to hash.- Returns:
- hash The generated SHA-256 hex hash of the data.
- Throws:
Exception- If generating a SHA-256 hex hash fails.
-
generate
Takes in a string, an encoding, and a hashing algorithm and generates a hex hash.- Parameters:
str- The string to hash.encoding- The character encoding to use.algorithm- The hashing algorithm to use.- Returns:
- hash The generated hex hash of the string.
- Throws:
Exception- If generating a hex hash of the string fails.
-
generate
Takes in a byte[], an encoding, and a hashing algorithm and generates a hex hash.- Parameters:
bytes- The byte[] to hash.algorithm- The hashing algorithm to use.- Returns:
- hash The generated hex hash of the byte[].
- Throws:
Exception- If generating a hex hash of the byte[] fails.
-