This may be help you.
public String getMD5(String str) throws NoSuchAlgorithmException {
| MessageDigest digest = java.security.MessageDigest.getInstance("MD5");
| digest.update(str.getBytes());
| byte[] hash = digest.digest();
|
| return hexStringFromBytes(hash);
| }
|
| public String hexStringFromBytes(byte[] b){
| char[] hexChars
={'0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F'};
| String hex = "";
|
| int msb;
|
| int lsb = 0;
| int j;
|
| // MSB maps to idx 0
|
| for (j = 0; j < b.length; j++){
|
| msb = ((int)b[j] & 0x000000FF) / 16;
| lsb = ((int)b[j] & 0x000000FF) % 16;
| hex = hex + hexChars[msb] + hexChars[lsb];
| }
| return(hex);
| }
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4199530#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...