crc_8h-source.html
来自「Crypto++是一个非常强大的密码学库,主要是功能全」· HTML 代码 · 共 54 行
HTML
54 行
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1"><title>Crypto++: crc.h Source File</title><link href="doxygen.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.3.2 --><div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Compound List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Compound Members</a> | <a class="qindex" href="globals.html">File Members</a></div><h1>crc.h</h1><div class="fragment"><pre>00001 <span class="preprocessor">#ifndef CRYPTOPP_CRC32_H</span>00002 <span class="preprocessor"></span><span class="preprocessor">#define CRYPTOPP_CRC32_H</span>00003 <span class="preprocessor"></span>00004 <span class="preprocessor">#include "<a class="code" href="cryptlib_8h.html">cryptlib.h</a>"</span>00005 00006 NAMESPACE_BEGIN(CryptoPP)00007 00008 <span class="keyword">const</span> word32 CRC32_NEGL = 0xffffffffL;00009 00010 <span class="preprocessor">#ifdef IS_LITTLE_ENDIAN</span>00011 <span class="preprocessor"></span><span class="preprocessor">#define CRC32_INDEX(c) (c & 0xff)</span>00012 <span class="preprocessor"></span><span class="preprocessor">#define CRC32_SHIFTED(c) (c >> 8)</span>00013 <span class="preprocessor"></span><span class="preprocessor">#else</span>00014 <span class="preprocessor"></span><span class="preprocessor">#define CRC32_INDEX(c) (c >> 24)</span>00015 <span class="preprocessor"></span><span class="preprocessor">#define CRC32_SHIFTED(c) (c << 8)</span>00016 <span class="preprocessor"></span><span class="preprocessor">#endif</span>00017 <span class="preprocessor"></span><span class="comment"></span>00018 <span class="comment">//! CRC Checksum Calculation</span><a name="l00019"></a><a class="code" href="class_c_r_c32.html">00019</a> <span class="comment"></span><span class="keyword">class </span><a class="code" href="class_c_r_c32.html">CRC32</a> : <span class="keyword">public</span> <a class="code" href="class_hash_transformation.html">HashTransformation</a>00020 {00021 <span class="keyword">public</span>:00022 <span class="keyword">enum</span> {DIGESTSIZE = 4};00023 <a class="code" href="class_c_r_c32.html">CRC32</a>();00024 <span class="keywordtype">void</span> <a class="code" href="class_c_r_c32.html#_c_r_c32a1">Update</a>(<span class="keyword">const</span> byte *input, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> length);00025 <span class="keywordtype">void</span> <a class="code" href="class_c_r_c32.html#_c_r_c32a2">TruncatedFinal</a>(byte *hash, <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> size);<a name="l00026"></a><a class="code" href="class_c_r_c32.html#_c_r_c32a3">00026</a> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> <a class="code" href="class_c_r_c32.html#_c_r_c32a3">DigestSize</a>()<span class="keyword"> const </span>{<span class="keywordflow">return</span> DIGESTSIZE;}00027 00028 <span class="keywordtype">void</span> UpdateByte(byte b) {m_crc = m_tab[CRC32_INDEX(m_crc) ^ b] ^ CRC32_SHIFTED(m_crc);}00029 byte GetCrcByte(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i)<span class="keyword"> const </span>{<span class="keywordflow">return</span> ((byte *)&(m_crc))[i];}00030 00031 <span class="keyword">private</span>:00032 <span class="keywordtype">void</span> Reset() {m_crc = CRC32_NEGL;}00033 00034 <span class="keyword">static</span> <span class="keyword">const</span> word32 m_tab[256];00035 word32 m_crc;00036 };00037 00038 NAMESPACE_END00039 00040 <span class="preprocessor">#endif</span></pre></div><hr size="1"><address style="align: right;"><small>Generated on Tue Jul 8 23:34:10 2003 for Crypto++ by<a href="http://www.doxygen.org/index.html"><img src="doxygen.png" alt="doxygen" align="middle" border=0 > </a>1.3.2 </small></address></body></html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?