MD5 算法 (The MD5 Message-Digest Algorithm)

MD5即Message-Digest Algorithm 5(信息-摘要算法 5),用于确保信息传输完整一致。是计算机广泛使用的雜湊算法之一(又译摘要算法、哈希算法),主流编程语言普遍已有MD5实现。

在维基百科上有详细介绍,在各种语言上也都已有相应实现。
http://www.ietf.org/rfc/rfc1321.txt 上给出了算法介绍和C语言的实现。
我们在使用过程中发现一个问题,就是计算出来的MD5值有误。
经过调查,并非算法有问题,而是因为机器是64位系统导致的,在32位系统上就没问题。
为了通用性,只要把md5.h中的41行,修改一下就可以了。
typedef unsigned int UINT4;

About 王永杰

路漫漫其修远兮,吾将上下而求索
This entry was posted in C&C++, linux应用, 技术为本. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>