Hi all,
I'm wanting to use MD5 in C and have found the following md5.c file along with the md5.h:
http://cr.yp.to/2004-494/gaim/0.81-src/md5.c
In the md5.c it has a test variable as below.
Code:static const char *const test[7] = { "12345678901234567890123456789012345678901234567890123456789012345678901234567890" /*57edf4a22be3c955ac49da2e2107b67a*/ };
I wish to change this test variable to accept numbers, so that I can keep generating MD5 of a variables like below (I don't have the exact code infront of me, but this is what I can remember that I did).
It compiles but it gives wrong results. If I do static const char *const test = "1283781913", it gives the correct results.Code:long myvar = 1283781913; char *my_str = ""; sprintf(mystr, "%li", myvar); static const char *const test = my_str;
Is there something wrong with my code or could anyone offer any assistance.
Thank you,
Alex.