Answer the question
In order to leave comments, you need to log in
Does Java have built-in MD5 functions?
Hello,
php has built-in functions for creating an MD5 hash, for example here:
Is there something similar in java?
Thank you very much in advance! md5("test");
Answer the question
In order to leave comments, you need to log in
import java.security.MessageDigest;
String md5(String in) {
String result = null;
try
{
MessageDigest digest = MessageDigest.getInstance("MD5");
digest.reset();
digest.update(in.getBytes());
BigInteger bigInt = new BigInteger(1, digest.digest());
result = bigInt.toString(16);
} catch (NoSuchAlgorithmException e) {
e.printStackTrace();
}
return result;
}
Quite already, right?
1. Google: md5 java
2. First line: stackoverflow.com/questions/415953/how-can-i-gener...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question