md5 result from CMD5 different from PHP md5 result
| Tue, 2008-09-02 16:47 | |
|
Hi, I'm trying to use the CMD5 class (in hash.h), to get the md5 hash of a string and pass it to a web page, however when I do the result is always different to what is returned from the md5 function in php. The code I'm using is TBuf<KDefaultBufferSize> userName;The result from PHP for "a" would be 0cc175b9c0f1b6a831c399e269772661. But from the above code the result for "a" is 4144e195f46de78a3623da7364d04f11 Can anyone help me out with getting this to work? |
|






Forum posts: 672
TBuf is unicode; 16 bit chars -- is it the same when doing php "stuff"?
Forum posts: 4
Thanks I did a search on that and it looks like you are right.
4144e195f46de78a3623da7364d04f11 is the md5 hash of the Unicode encoding of "a", while 0cc175b9c0f1b6a831c399e269772661 is the md5 hash of the ascii encoding.
Is there a way to convert the unicode to ascii on Symbian? As I can't change the web application I need to connect to.
Forum posts: 165
Hi matrim,
you can checkout these link to convert Unicode to UTF8
http://www.newlc.com/topic-4891
http://discussion.forum.nokia.com/forum/showthread.php?t=28110
also checkout CnvUtfConverter class in sdk.
hopefully this will help you.
Thanks & Regards,
Md.Khalid Ahmad
Forum posts: 4
Thanks, declaring a TBuf8 and using the copy function on the TBuf before the hash seems to do it.