码迷,mamicode.com
首页 > 其他好文 > 详细

DCPcrypt

时间:2015-07-28 10:39:24      阅读:114      评论:0      收藏:0      [点我收藏+]

标签:

delphi dcp component 

procedure TForm1.Button1Click(Sender: TObject);
var
  hashd: array [0 .. 31] of Byte;
  abytes: TByteDynArray;
  s: string;
  read, len: integer;
  ast: AnsiString;
begin
  ast := 中国;
  self.DCP_md51.Init;
  self.DCP_md51.UpdateStr(ast);
  self.DCP_md51.Final(hashd);
  len := DCP_md51.HashSize;
  s := ‘‘;
  for Read := 0 to ((len div 8) - 1) do
    s := s + IntToHex(hashd[Read], 2);
  Caption := s;
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  hashd: array [0 .. 31] of Byte;
  s: string;
  read, len: integer;
  ast: string;
begin
  ast := 中国;
  self.DCP_md51.Init;
  self.DCP_md51.UpdateStr(ast);
  self.DCP_md51.Final(hashd);
  len := DCP_md51.HashSize;
  s := ‘‘;
  for Read := 0 to ((len div 8) - 1) do
    s := s + IntToHex(hashd[Read], 2);
  Caption := s;

end;

procedure TForm1.Button3Click(Sender: TObject);
var
  hashd: array [0 .. 41] of Byte;
  s: string;
  read, len: integer;
  ast: AnsiString;
begin
  ast := 中国;
  self.DCP_sha11.Init;
  self.DCP_sha11.UpdateStr(ast);
  self.DCP_sha11.Final(hashd);
  len := DCP_sha11.HashSize;
  s := ‘‘;
  for Read := 0 to ((len div 8) - 1) do
    s := s + IntToHex(hashd[Read], 2);
  Caption := s;
end;

 

DCPcrypt

标签:

原文地址:http://www.cnblogs.com/cb168/p/4682008.html

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