Possible Duplicate:
Generate MD5 hash in Java
Can some one tell me how to convert a string into MD5 format in Java?
I have code like this, but I want in MD5 format with 32 characters.
UUID uuid = UUID.randomUUID();
String token = uuid.toString().substring(0,12);
Implemenation
Usage:
Output:
MD5: 91162629d258a876ee994e9233b2ad87*
In this sample was used the coding UTF-8.
What is Charset ?
What is MessageDigest ?
What is UTF-8 >
*md5 is example from Wikipedia.