|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.riotfamily.common.util.HashUtils
public final class HashUtils
Utility class that simplifies the generation of MD5 and SHA-1 hashes.
Field Summary | |
---|---|
static String |
MD5
|
static String |
SHA1
|
Method Summary | |
---|---|
static String |
hash(byte[] data,
String algorithm)
Hashes a byte array using the specified algorithm and returns the result as a String of hexadecimal numbers. |
static String |
hash(InputStream in,
String algorithm)
Hashes data read from an InputStream using the specified algorithm and returns the result as a String of hexadecimal numbers. |
static String |
hash(String data,
String algorithm)
Hashes a String using the specified algorithm and returns the result as a String of hexadecimal numbers. |
static String |
md5(byte[] data)
Hashes a byte array using the MD5 algorithm and returns the result as a String of hexadecimal numbers. |
static String |
md5(InputStream in)
Hashes an InputStream using the MD5 algorithm and returns the result as a String of hexadecimal numbers. |
static String |
md5(String data)
Hashes a String using the MD5 algorithm and returns the result as a String of hexadecimal numbers. |
static String |
sha1(byte[] data)
Hashes a byte array using the SHA-1 algorithm and returns the result as a String of hexadecimal numbers. |
static String |
sha1(String data)
Hashes a String using the SHA-1 algorithm and returns the result as a String of hexadecimal numbers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final String MD5
public static final String SHA1
Method Detail |
---|
public static String md5(String data)
public static String md5(byte[] data)
public static String md5(InputStream in) throws IOException
IOException
public static String sha1(String data)
public static String sha1(byte[] data)
public static String hash(String data, String algorithm)
data
- the String to compute the hash of
public static String hash(byte[] data, String algorithm)
data
- the bytes to compute the hash of
public static String hash(InputStream in, String algorithm) throws IOException
in
- the stream to read the data from
IOException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |