+ 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/

21st Dec 2020, 8:46 PM
hamid
hamid - avatar
4 Respuestas
0
How are you generating your hash? https://www.baeldung.com/java-md5
24th Dec 2020, 6:39 AM
Edgar Díaz
Edgar Díaz - avatar
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
24th Dec 2020, 7:24 AM
hamid
hamid - avatar
0
I'm using this in eclipse also I've never understood what is (0xFF & ndigest[i]) https://code.sololearn.com/c7N3WRF5ftwJ/?ref=app
24th Dec 2020, 7:46 AM
hamid
hamid - avatar
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
24th Dec 2020, 3:24 PM
Edgar Díaz
Edgar Díaz - avatar