kbmMW TkbmMWHashSHA256与Delphi 10.2 THashSHA2算出相同的结果

2021-03-30 02:26

阅读:532

标签:label   create   send   span   alt   salt   proc   click   div   

procedure TForm2.Button3Click(Sender: TObject);
var
  hashed:string;
begin
  hashed:=TkbmMWHashSHA256.HashAsString(mypassword,somesaltvalue);
  Label1.Caption:=TkbmMWHashSHA256=+hashed;
end;

procedure TForm2.Button4Click(Sender: TObject);
var
  hashed:string;

//  hashed:=THashSHA2.GetHashString(‘a3k4p5‘);
//  hashed:=THashSHA2.GetHMAC(‘a3k4p5‘,‘somesaltvalue‘);
//  Label2.Caption:=‘Delphi THashSHA2.GetHMAC=‘+hashed.ToUpper;
  LSHA2: THashSHA2;
begin
  LSHA2 := THashSHA2.Create;//(SHA256);
  LSHA2.Update(somesaltvalue);
  LSHA2.Update(mypassword);
  hashed:=LSHA2.HashAsString;
  Label2.Caption:=Delphi LSHA2.HashAsString=+hashed.ToUpper;
end;

end.

 

kbmMW TkbmMWHashSHA256与Delphi 10.2 THashSHA2算出相同的结果

标签:label   create   send   span   alt   salt   proc   click   div   

原文地址:https://www.cnblogs.com/kinglandsoft/p/9285039.html


评论


亲,登录后才可以留言!