this slowpoke moves

MD5 File Calculator

uses IdHashMessageDigest, idHash

function MD5(const fileName : string) : string;
 var
   idmd5 : TIdHashMessageDigest5;
   fs : TFileStream;
   hash : T4x4LongWordRecord;
 begin
   idmd5 := TIdHashMessageDigest5.Create;
   fs := TFileStream.Create(fileName, fmOpenRead OR fmShareDenyWrite) ;
   try
     result := idmd5.AsHex(idmd5.HashValue(fs)) ;
   finally
     fs.Free;
     idmd5.Free;
   end;
end;
Beispiel :
procedure TForm1.Button1Click(Sender: TObject);
begin
  if OpenDialog1.Execute then
  Edit1.Text :=  MD5(OpenDialog1.FileName);
end;

Keine Kommentare:

Kommentar veröffentlichen

Beliebte Posts

Translate