How to manually write MD5 (to get the hash of a file) algorithm in Java?

1k Views Asked by At

Well, I kinda have a task where I have to take a file and generate MD5 hash of that file. Problem is that I can't really use any classes that would automate this processes so everything has to be programmed manually. And that prob would mean that I can't use java.security.MessageDigest >> getInstance("MD5") to get an MD5 message. So yeah I am not really sure how to write needed algorithm because it seems that everyone uses MessageDiggest Class. Any ideas?

2

There are 2 best solutions below

0
Jens Van Reusel On BEST ANSWER

I found this implementation of MD5: https://rosettacode.org/wiki/MD5/Implementation#Java

I haven't tested if this is 100% correct though

0
Benoit On

Well I see 2 options: