MD5 in Java Compatible With PHP md5() Function

The request was to have a Java function generating the same MD5 string generated by PHP when using the md5() function. Here the code snippet:

Please, note the check on the “toString()” result which must be padded with a zero if needed.

Have a nice hashing!

My excuses for my bad english but it's the only way I have to communicate with you. Would you suggest a correction? Leave a comment, thank you!

Leave a Reply