MD5 hash of a string in C
John Grube

I need to get the MD5 hash of a string so I can send it to a webserver, but all the examples I find all come up with linker errors. I'm using MinGW to compile different C examples, and like I said, they don't work. So, does anyone have any working code they'd be willing to share or does anyone have any links to something that does work?

Edit: Actually, something for SHA-1 would work too.

Jonatan Hedborg

I found one on google fairly quickly. There were some compile errors, but i didnt need those functions anyway. It was for C++.

dudaskank
John Grube
Quote:

I found one on google fairly quickly. There were some compile errors, but i didnt need those functions anyway. It was for C++.

Yes, but I need one for C.

Quote:

That was one of the ones I tried. I keep getting the following errors:

Quote:

[Linker error] undefined reference to `WinMain@16'
ld returned 1 exit status
C:\Documents and Settings\John\Desktop\md5-3\Makefile.win [Build Error] [md5.exe] Error 1

Is there a library I need to tell the linker to use?

BAF

Look at the source for md5sum on linux... http://www.netlib.org/crc/md5sum.c

Thread #586270. Printed from Allegro.cc