How do I generate an MD5 digest for a file?
Author: Deron Eriksson
Description: This Java tutorial describes how to generate an MD5 digest for a file.
Tutorial created using: Windows XP || JDK 1.5.0_09 || Eclipse Web Tools Platform 2.0 (Eclipse 3.3.0)
(Continued from page 1)
The execution of MessageDigestForFile generates the following console output:
The ApacheSW website at http://www.apache.org/dist/httpd/httpd-2.2.6-win32-src-r2.zip.md5 displays the following digest:
httpd-2.2.6-win32-src-r2.zip: 30 1D 61 85 3F C9 CE 94 BB FB 55 B5 6C 21 8D 06
An examination of the generated digest with the expected digest shows that they are identical (although formatted differently).