Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » MD5 hash of a string in C

This thread is locked; no one can reply to it. rss feed Print
MD5 hash of a string in C
John Grube
Member #7,432
July 2006

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
Member #4,886
July 2004
avatar

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

dudaskank
Member #561
July 2000
avatar

Toque a balada do amor inabalável, eterna love song de nós dois
Eduardo "Dudaskank"
[ Home Page (ptbr) | Blog (ptbr) | Tetris 1.1 (ptbr) | Resta Um (ptbr) | MJpgAlleg 2.3 ]

John Grube
Member #7,432
July 2006

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
Member #2,981
December 2002
avatar

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

Go to: