如何在C ++中计算文件md5? [英] How to calculate a the files md5 in c++?
本文介绍了如何在C ++中计算文件md5?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
再次振作起来
如何计算文件md5并在VC ++中进行比较
香港专业教育学院搜索谷歌,但没有运气...
再次进行Tnx:)
Hellow Again
How to calculate the files md5 and compare it in VC++
Ive searched in google but no luck ...
Tnx Again :)
推荐答案
然后,您的搜索并不困难,对吗?
我尝试 使用您的主题行作为搜索词 ,然后立即来到这里: ^ ]
You didn''t search too hard then, did you?
I tried using your subject line as a search term and got here straight away: Use Windows Crypto API to calculate a MD5 string.[^]
有一个比旋转完整加密货币更容易的选择;看看邮件摘要功能 [ ^ ]
There''s an easier alternative than spinning up the full crypto; have a look at the Message Digest functions[^]
typedef struct {
ULONG i[2];
ULONG buf[4];
unsigned char in[64];
unsigned char digest[16];
} MD5_CTX;
typedef void (_stdcall *MD5Final)(MD5_CTX* context);
typedef void (_stdcall *MD5Init)(MD5_CTX* context);
typedef void (_stdcall *MD5Update)(MD5_CTX* context,unsigned char* input,unsigned int inlen);
对这三个函数分别执行LoadLibrary("cryptdll.dll")
,GetProcAddress()
,根据需要多次调用MD5Init()
,MD5Update()
,然后依次调用MD5Final()
和FreeLibrary()
Do a LoadLibrary("cryptdll.dll")
, GetProcAddress()
for each of the three functions, call MD5Init()
, MD5Update()
as many times required, then MD5Final()
, and FreeLibrary()
这篇关于如何在C ++中计算文件md5?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文