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″, “SHA-256″, “SHA-384″, “SHA-512″.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

1 Trackback