Added String method
This commit is contained in:
parent
b7cc0e7fd9
commit
a28d2b219e
1 changed files with 11 additions and 0 deletions
|
|
@ -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
|
||||
*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue