Jump to content

BUG Calculating MD5 hash


dison

Recommended Posts

I have a function to calculate MD5 hash of a string that work fine in a win32 app but this same function fail on unigui return a empty string

 

function TFLogin.MD5(const text: string): string;

var

md5 : TIdHashMessageDigest5;

begin

md5 := TIdHashMessageDigest5.Create;

Result := LowerCase(md5.HashStringAsHex(text, TEncoding.ASCII));

md5.Free;

end;

  • Upvote 1
Link to comment
Share on other sites

this file can use the MD5 code delphi club is solamnete I put it in a country that could be used to more easily:

 

attached file and put the example how to use.

 

Note: change the file extension from. Txt to. Pas

 

// sha1

 

ShowMessage(CalcHash2('The quick brown fox jumps over the lazy dog',haSHA1));

 

// md5

 

ShowMessage(CalcHash2('The quick brown fox jumps over the lazy dog',haMD5));

 

Hope this helps ;)

Hashes.txt

post-482-0-93234300-1354204134.png

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...