crc32.cpp

来自「经典的string 函数库学习资料」· C++ 代码 · 共 36 行

CPP
36
字号
/** * @file crc32.cpp * @brief 字符串的包装,crc32校验 * @author 泥偶 * @since  2003-09-27 * @date   2003-09-27 */#include "xstring.hpp"namespace x{    namespace    {        #include "crc32.c"    }//----------------------------------------------------------------------------    /**    生成字符串循环冗余校验多项式的和。这通常用来在数据传输过程中验证数据的有效    性。    @code  * xstring str = "The quick brown fox jumped over the lazy dog.";  * unsigned int checksum = str.crc32();  * cout << checksum;   // 输出 2191738434    @endcode    @see md5() sha1()     */    unsigned int xstring::crc32(void) const    {        return x::crc32(0, this->data(), this->size());    }}   // namespace x

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?