char* MDString (char* string) { MD5_CTX context; unsigned char digest[16]; char output1[32]; static char output[33] = {""}; unsigned int len = strlen(string); int i; MD5Init(&context); MD5Update(&context, (unsigned char*)string, len); MD5Final(digest, &context); for (i = 0; i < 16; i++) { sprintf(&(output1[2*i]),"%02x",(unsigned char)digest[i]); sprintf(&(output1[2*i+1]),"%02x",(unsigned char)(digest[i]<<4)); } for(i=0;i<=32;i++) output[i] = output1[i]; return output; }
output1
i
sprintf
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)