org.springframework.util
Class Md5HashUtils

java.lang.Object
  extended by org.springframework.util.Md5HashUtils

public abstract class Md5HashUtils
extends Object

Miscellaneous method for calculating MD5 hashes.

Since:
3.0
Author:
Arjen Poutsma

Constructor Summary
Md5HashUtils()
           
 
Method Summary
static StringBuilder appendHashString(byte[] bytes, StringBuilder builder)
          Append a hex string representation of the MD5 hash of the given bytes to the given StringBuilder.
static byte[] getHash(byte[] bytes)
          Calculate the MD5 hash of the given bytes.
static String getHashString(byte[] bytes)
          Return a hex string representation of the MD5 hash of the given bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Md5HashUtils

public Md5HashUtils()
Method Detail

getHash

public static byte[] getHash(byte[] bytes)
Calculate the MD5 hash of the given bytes.

Parameters:
bytes - the bytes to calculate the hash over
Returns:
the hash

getHashString

public static String getHashString(byte[] bytes)
Return a hex string representation of the MD5 hash of the given bytes.

Parameters:
bytes - the bytes to calculate the hash over
Returns:
a hexadecimal hash string

appendHashString

public static StringBuilder appendHashString(byte[] bytes,
                                             StringBuilder builder)
Append a hex string representation of the MD5 hash of the given bytes to the given StringBuilder.

Parameters:
bytes - the bytes to calculate the hash over
builder - the string builder to append the hash to
Returns:
the given string builder