Calculating a MD5, SHA1, SHA256, SHA384, SHA512 Hash in Java

Hi, today I will show you with examples how to evaluate Hashes in Java programming languages. I hope this information comes in useful for many people.

Java which is my favorite programming language because of sheer simplicity, vastness and ease with which you can customize and extend existing libraries to suit your needs.

This function as you can see yourself, calculates the hash of an input ‘message’ String based on the ‘algorithm’ to be used. The valid values for the String ‘algorithm’ are “MD2″, “MD5″, “SHA1″, “SHA256″, “SHA384″, “SHA512″.

VN:F [1.9.22_1171]
Rating: 5.0/5 (3 votes cast)
VN:F [1.9.22_1171]
Rating: +1 (from 1 vote)
Calculating a MD5, SHA1, SHA256, SHA384, SHA512 Hash in Java, 5.0 out of 5 based on 3 ratings

Leave a Reply