⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 crc32.cpp

📁 含有多种公开密钥算法、多种块加密、多种数据流加密、多种HASH函数、多种CheckSum校验、多种MAC校验等几十种加密算法的程序
💻 CPP
字号:
/************************************************** CRC32 Source File                              ** (C) 1999-2002 The Botan Project                **************************************************/#include <botan/crc32.h>namespace Botan {/************************************************** Update a CRC32 Hash                            **************************************************/void CRC32::add_data(const byte input[], u32bit length)   {   u32bit tmp = crc;   while(length >= 16)      {      tmp = TABLE[(tmp ^ input[ 0]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 1]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 2]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 3]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 4]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 5]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 6]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 7]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 8]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[ 9]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[10]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[11]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[12]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[13]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[14]) & 0xFF] ^ (tmp >> 8);      tmp = TABLE[(tmp ^ input[15]) & 0xFF] ^ (tmp >> 8);      input += 16;      length -= 16;      }   for(u32bit j = 0; j != length; j++)      tmp = TABLE[(tmp ^ input[j]) & 0xFF] ^ (tmp >> 8);   crc = tmp;   }/************************************************** Finalize a CRC32 Hash                          **************************************************/void CRC32::final_result(byte output[])   {   crc ^= 0xFFFFFFFF;   for(u32bit j = 0; j != 4; j++)      output[j] = get_byte(j, crc);   clear();   }}

⌨️ 快捷键说明

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