CSHA1 - 實現SHA1算法的 C++ 類庫。
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
本文由用戶 openkk 自行上傳分享,僅供網友學習交流。所有權歸原作者,若您的權利被侵害,請聯系管理員。
轉載本站原創文章,請注明出處,并保留原始鏈接、圖片水印。
本站是一個以用戶分享為主的開源技術平臺,歡迎各類分享!