Added String method

This commit is contained in:
Ziver Koc 2009-05-09 11:33:25 +00:00
parent b7cc0e7fd9
commit a28d2b219e

View file

@ -70,6 +70,17 @@ public class Hasher {
return null;
}
/**
* Hashes the given String as UTF8
*
* @param object is the String
* @param hashType is the hash algorithm (MD2, MD5, SHA-1, SHA-256, SHA-384, SHA-512 )
* @return a hex String of the hash
*/
public static String hash(String object, String hashType) throws Exception {
return hash(object.getBytes("UTF8"), hashType);//(new BASE64Encoder()).encode(raw);
}
/**
* Returns the hash of the given object
*