+ 2
MD5 HASH CODE IN JAVA !!!
why generating md5 hash code in java using MassageDigest is not the same as what this website or others generate??? https://www.md5online.org/
4 Réponses
0
How are you generating your hash?
https://www.baeldung.com/java-md5
0
Edgar Díaz exactly like this one
it works almost fine here but in eclipse you can see that some zero or sometimes some other things missed
https://code.sololearn.com/cevt24EuVhIY/?ref=app
0
I'm using this in eclipse
also I've never understood what is (0xFF & ndigest[i])
https://code.sololearn.com/c7N3WRF5ftwJ/?ref=app
0
For get hash md5 with pure java:
String password = "ILoveJava";
MessageDigest md = MessageDigest.getInstance("MD5");
md.update(password.getBytes());
byte[] digest = md.digest();
String myHash = DatatypeConverter
.printHexBinary(digest).toUpperCase();
I prefer to use apache commons:
String password = "ILoveJava";
String md5Hex = DigestUtils.md5Hex(password).toUpperCase();
https://www.baeldung.com/java-md5