Package com.castlabs.utils
Class HashUtils
java.lang.Object
com.castlabs.utils.HashUtils
Utility hash functions
-
Constructor Summary
-
Method Summary
-
Constructor Details
-
HashUtils
public HashUtils()
-
-
Method Details
-
md5
Takes a string and returns the HEX representation of the MD5 sum for the given string.- Parameters:
source
- the string- Returns:
- md5 hex string
-
decodeHex
public static byte[] decodeHex(char[] data) Converts an array of character bytes representing hexadecimal values into an array of bytes of those same values. The returned array will be half the length of the passed array, as it takes two characters to represent any given byte. An exception is thrown if the passed char array has an odd number of elements.- Parameters:
data
- array of input data containing hex characters- Returns:
- byte array containing teh binary data decoded from the given input data
-