[jdev] Md5 again...
justin-keyword-jabber.093179 at affinix.com
Thu May 6 05:32:44 CDT 2004
echo adds a newline. try with 'echo -n'.
On Thursday 06 May 2004 3:27 am, Remy HAREL wrote:
> Hi all,
> I'd like to hash this string
> rem at jabber.gicm.net/Gabber
> with MD5, when I run echo rem at jabber.gicm.net/Gabber|md5sum I got this
> result :
> 8a6d946e132886e619bf5eb3bb9e7dbd where as in my jabberd server, I got :
> This is the part of my code c2s/c2s.c which is responsible for encoding
> the string to MD5 :
> md5_state_t temp;
> md5_byte_t result;
> char *jidMD5;
> md5_append(&temp,(char*) sess->jid, strlen((char*) sess->jid)
> ); md5_finish(&temp, result);
> jidMD5Hex = (char*) malloc(2* sizeof(md5_byte_t)*16 + 1);
> hex_from_raw(result, sizeof(md5_byte_t)*16, jidMD5Hex);
> Please someone can help me, I don't understand what is wrong with that.
More information about the JDev