sha1
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;
本文来自博客园,作者:{咏南中间件},转载请注明原文链接:https://www.cnblogs.com/hnxxcxg/p/14240458.html