码迷,mamicode.com
首页 > Windows程序 > 详细

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

时间:2018-07-09 19:20:57      阅读:688      评论:0      收藏:0      [点我收藏+]

标签: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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!