CSHA1 - 实现SHA1算法的 C++ 类库。

openkk 12年前

CSHA1 是实现快速 SHA1 安全哈希算法的 C++ 类库。

示例代码:

CSHA1 sha1;  sha1.Update(string0, strlen(string0));  sha1.Update(string1, strlen(string1));  sha1.Update(binary2, uSizeOfBufferBinary2);  sha1.Update(binary3, uSizeOfBufferBinary3);  sha1.Final();    sha1.ReportHash(szReport, CSHA1::REPORT_HEX_SHORT);  // or  sha1.GetHash(binaryArray);    CSHA1 sha1;  sha1.HashFile("TheFile.cpp"); // Hash in the contents of the file                                // 'TheFile.cpp'  sha1.Final();    sha1.ReportHash(szReport, CSHA1::REPORT_HEX); // Get final hash as                                                // pre-formatted string  // or  sha1.GetHash(binaryArray); // Get the raw message digest bytes to a                             // temporary buffer

项目主页:http://www.open-open.com/lib/view/home/1340151801174