Hexer
Member
|
MD5 how?
Hi!
How use Md5 in Esenthel?
Can you some sample code?
|
|
06-28-2013 01:24 PM |
|
Pixel Perfect
Member
|
RE: MD5 how?
Are you referring to the hash function?
|
|
06-28-2013 04:39 PM |
|
Hexer
Member
|
RE: MD5 how?
(06-28-2013 04:39 PM)Pixel Perfect Wrote: Are you referring to the hash function?
Yes
|
|
06-28-2013 04:56 PM |
|
Pixel Perfect
Member
|
RE: MD5 how?
I have no idea off the top of my head what the algorithm is. If I were you I'd Google it and see if you can't find some C++ source code for it.
|
|
06-28-2013 07:02 PM |
|
Rubeus
Member
|
RE: MD5 how?
You could try something like:
UID _uid = MD5Mem( &ObjectToHash, SIZE( ObjectToHash ) );
Is that what you were looking for?
|
|
06-28-2013 08:44 PM |
|
Hexer
Member
|
RE: MD5 how?
UID id_hash, id_pass;;
Str pass="123";
Str hash_pass="202cb962ac59075b964b07152d234b70";
id_pass.fromText(hash_pass);
id_hash=MD5Mem(&pass, SIZE(pass));
D.text(0, -0.1, S+"Result: "+Compare(id_pass, id_hash));
Why they are not equal?
|
|
06-28-2013 11:27 PM |
|
Rubeus
Member
|
RE: MD5 how?
You got me there. Esenthel will have to answer this one.
|
|
06-29-2013 03:04 AM |
|
Esenthel
Administrator
|
RE: MD5 how?
you are calculating hash of the Str C++ object, and not the string itself, you should do:
// wide char
Str s;
MD5Mem(s(), s.length()*SIZE(*s()));
or
// 1-byte char
Str8 s8=s;
MD5Mem(s8(), s8.length()*SIZE(*s8()));
|
|
06-29-2013 10:21 AM |
|