COMMONS-CODEC packages can be downloaded from Apache: http://commons.apache.org/codec/download_codec.cgi
MD5 is now used as a digital signature algorithm, where a sends data m to B, in order for B to be convinced that the data is sent by a and not tampered with, so a is hashing the data into a hash algorithm and sending it to B. b After receiving the file, the same hash algorithm is used to verify that the data is modified. Primarily to prevent data from being modified. The repetition of the MD5 value is called collision.
get MD5 code for file:
System.out.println (New FileInputStream ("c:/ttt/new1328505655521")) (New File ("Digestutils.md5hex"));
Get string MD5 code:
System.out.println (Digestutils.md5hex (string));
Reference article: http://hi.baidu.com/xghrbc1001/item/9bf046e7d95d9caac00d754b
Linux View file MD5 value command
Md5sum local_nikitrailer1.flv