1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2002
    Rep Power

    MD5 a string? (test code inside)

    How do I get the MD5 hash of a string?

    I tried:

    PHP Code:

    szMd5String md5("test"); 
    And received:

    ...testa.cpp(12) : error C2065: 'md5' : undeclared identifier
    ...testa.cpp(12) : error C2440: '=' : cannot convert from 'int' to 'char *'
    Conversion from integral type to pointer type requires
    reinterpret_cast, C-style cast or function-style cast
    Error executing cl.exe.

  2. #2
  3. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Woodland Hills, Los Angeles County, California, USA
    Rep Power
    Is this on a *NIX like system. If so, I believe you're looking for a function is called MD5(), (MD5Data() or MD5File() on FreeBSD/OpenBSD). Also, you may need to tell the compiler to link to libmd.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo

IMN logo majestic logo threadwatch logo seochat tools logo