Page 1 of 1

A simple question about md5 hashing in php [Solved]

Posted: Fri Aug 12, 2011 10:38 am
by David3
Hi all. I'm a newbie in php. what i need to do is to do md5 hashing on some hex values. for example:
I wanna do an md5 hash of 0x14. the actual hash of that, is:
15f41a2e96bae341dde485bb0e78f485
but i can not reproduce that in php.

md5 (0x14); Doesnt work
even md5(chr(hexdec(14))); doesnt work. cause its not an actual character

I tried every possibility that i could think of. none of them gave me the right hash
How can i make this work? its really essential for me
Thanks in advance
Best Regards
David

Re: A simple question about md5 hashing in php. please help

Posted: Fri Aug 12, 2011 10:53 am
by Celauran

Code: Select all

hash('md5', chr('0x14'))

Re: A simple question about md5 hashing in php. please help

Posted: Fri Aug 12, 2011 12:30 pm
by David3
Damn. it works. thank you man :) you saved my day

Best Regards
David