简单到极致

获取文件sha1 值

 

单元 IdHashSHA申明

function GetFile_SHA1(const iFileName: String): String; //Checksum hash value for firefox

var
SHA1 : TIdHashSHA1;
fileStream: TMemoryStream;
begin
SHA1 := TIdHashSHA1.Create;
fileStream := TMemoryStream.Create;
try
fileStream.LoadFromFile(iFileName);
Result := SHA1.HashStreamAsHex(fileStream);
finally
fileStream.Free;
SHA1.Free;
end;
end;

posted @ 2014-05-07 07:00  ring_hacker  阅读(1406)  评论(0编辑  收藏  举报