随笔分类 -  算法

摘要://************************************ // 函数名:CEncryptionDlg::CalculateHash // 返回类型:BOOL // 功能: 计算hash值 // 参数1:BYTE *pData 需要计算哈希值的数据 // 参数2:DWORD dwD 阅读全文
posted @ 2020-06-22 18:10 自己的小白 阅读(2047) 评论(0) 推荐(0)
摘要: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 ( 阅读全文
posted @ 2020-05-01 13:55 自己的小白 阅读(1187) 评论(1) 推荐(0)
摘要://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, 阅读全文
posted @ 2020-05-01 13:52 自己的小白 阅读(2012) 评论(0) 推荐(0)
摘要:#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 阅读全文
posted @ 2020-04-29 22:05 自己的小白 阅读(1265) 评论(0) 推荐(0)
摘要://base64加密函数 string Encode(const unsigned char* Data, int DataByte) { //编码表 const char EncodeTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrst 阅读全文
posted @ 2020-04-29 21:59 自己的小白 阅读(646) 评论(0) 推荐(0)