CSHA1 介绍
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
CSHA1 官网
http://www.codeproject.com/Articles/2463/CSHA1-A-C-Class-Implementation-of-the-SHA-1-Hash-A
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 [email protected] 举报,一经查实,本站将立刻删除。