zoukankan      html  css  js  c++  java
  • DCPcrypt

    delphi dcp component 

    TDCP_md5

    md5 String;

    md5 stream;流文件

    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;

    stream

    procedure TForm1.Button1Click(Sender: TObject);
    var
      hashd: array [0 .. 31] of Byte;
      s: string;
      read, len: integer;
      ast: AnsiString;
      ss: TStringStream;
    begin
      ast := '中国';
      ss := TStringStream.Create;
      ss.WriteString('ww');
    
      self.DCP_md51.Init;
      DCP_md51.UpdateStream(ss, ss.Size);
      self.DCP_md51.Final(hashd);
      ss.Free;
    
      len := DCP_md51.HashSize;
      s := '';
      for Read := 0 to ((len div 8) - 1) do
        s := s + IntToHex(hashd[Read], 2);
      Caption := s;
    end;
  • 相关阅读:
    typescript
    pyqt5窗口跳转
    pyqt5 列表内添加按钮
    C#窗体最大化,其他控件调整
    C#禁止程序重复打开
    C#添加 mysql.data.dll
    宝塔一键ssl
    宝塔Linux面板 使用阿里云OSS备份数据
    CentOS7使用firewalld打开关闭防火墙与端口
    使用babel编译es6
  • 原文地址:https://www.cnblogs.com/cb168/p/4682008.html
Copyright © 2011-2022 走看看