随笔分类 - 算法
摘要://************************************ // 函数名:CEncryptionDlg::CalculateHash // 返回类型:BOOL // 功能: 计算hash值 // 参数1:BYTE *pData 需要计算哈希值的数据 // 参数2:DWORD dwD
阅读全文
摘要:typedef unsigned int uint; uint POLYNOMIAL = 0xEDB88320; int have_table = 0; uint table[256]; void make_table() { int i, j, crc; have_table = 1; for (
阅读全文
摘要://Md5.htypedef struct { unsigned int count[2]; unsigned int state[4]; unsigned char buffer[64]; }MD5_CTX; #define F(x,y,z) ((x&y)|(~x&z)) #define G(x,
阅读全文
摘要:#pragma once #ifndef SHA1_H #define SHA1_H #include "stdint.h" typedef struct { uint32_t state[5]; uint32_t count[2]; unsigned char buffer[64]; } SHA1
阅读全文
摘要://base64加密函数 string Encode(const unsigned char* Data, int DataByte) { //编码表 const char EncodeTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst
阅读全文