sha1

uses
IdHashSHA, IdGlobal;

function SHA1(Input: string): string;
var sha1: TIdHashSHA1;
begin
  sha1 := TIdHashSHA1.Create;
  try
    Result := LowerCase(sha1.HashBytesAsHex(TidBytes(Bytesof(Input))));
  finally
    sha1.Free;
  end;
end;

procedure TForm2.Button1Click(Sender: TObject);
begin
  var s: String := '咏南中间件';
  Memo1.Text := UpperCase(SHA1(s));   //1BCF1857425600BB9FA8BE390E129715F36A9160
end;

  

相关文章:

  • 2021-04-20
  • 2021-05-03
  • 2021-07-28
  • 2021-11-18
  • 2021-10-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-26
  • 2021-08-12
  • 2021-08-12
  • 2021-11-08
相关资源
相似解决方案