Creating MessageDigest - 2
7 May 2008This post is in continuation of “Creating MessageDigest - 1″. Do read that before going through this one.
In the last post, I presented an example. It was shown that we generated a MD5 hash code for the string. The output we got was:
String: Hello World MessageDigest: b10a8db164e0754105b7a99be72e3fe5
Lets do some experiments. I changed the string slighlty and got entirely different hash code. Review the output:
String: hello World MessageDigest: 39d11ab1c3c6c9eab3f5b3675f438dbf
You have 3 different methods to generate the digest. Use the one as required.
byte[] digest() byte[] digest(byte[] input) int digest(byte[] buf, int offset, int len)
As a developer, you need not to worry about MD5 algorithm implementation. So, generating message digests is very simple and easy.
Related Posts:
- Creating MessageDigest - 1
- Creating JAR files - 2
- Creating JAR files
- Creating a Thread (implementing Java Runnable Interface)
- Creating a Simple Plug-in using PDE (II)
- Creating a plug-in project (I)
- Creating and visualizing graphs - JGraphT(I)
- Taking inputs from users
- Apache Struts (I)
- Creating a plug-in project (II)
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Creating MessageDigest - 2