well here is what i came up with after searching, .. but i want it to be like the 32 character hash that the php md5() function creates.
Code:
public static String encryptString(String str){
byte[] originalByteArray = str.getBytes();
String returnString = "";
try{
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.reset();
digest.update(originalByteArray);
byte[]arr = digest.digest();
returnString = arr.toString();
}catch(Exception e){
System.out.println("Error:encryptString()");
return returnString;
}
return returnString;
}