MD5 issue

Hi all,
I tried to generate check sum using juce MD5, The check sum that it returned was different from what i got from different web sites(check sum from different web sites where same).
The sites that i had used were :

I don’t understand it because check sum cannot be different for the same string. I am putting in a snippet of my code.

        juce::MD5 checkSum = juce::MD5 (T("")); 
	juce::Logger::outputDebugString(T("Check sum : ") + checkSum.toHexString());
  This logs "7f949c6a27ae1ec40cd820f355a5d66e" but the web sites show "0a0adbe3f198497ae75a9e167490af81".

Is there something am doing wrong or it’s an issue with juce am working with juce 1.46. It can be generated on both mac and pc.


The juce code will operate on strings as unicode - maybe the websites are treating it as utf8 or ascii?

is there anyway i can generate the same value as those generated by the web-sites

Try feeding it a utf8 binary instead of a string?

it didn’t work am still getting the same value.

If you got the same result, then obviously you’re feeding it the same data (!!)

Make sure you’re calling the binary constructor, and not the one that takes a string!

yeah you were right :oops: . I had to use “MD5 (const char* data, const int numBytes)”

thanks julian