资 源 简 介
char *MD5_file (char *path, int md5_len)
{
FILE *fp = fopen (path, "rb");
MD5_CTX mdContext;
int bytes;
unsigned char data[1024];
char *file_md5;
int i;
if (fp == NULL) {
fprintf (stderr, "fopen %s failed
", path);
return NULL;
}
MD5Init (&mdContext);
while ((bytes = fread (data, 1, 1024, fp)) != 0)
{
MD5Update (&mdContext, data, bytes);
}
MD5Final (&mdContext);
file_md5 = (char