概述unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdHashMessageDigest,IdGlobal, IdHash,util_utf8; type TForm1 = class(TForm unit Unit1; interface uses windows,Messages,SysUtils,Variants,Classes,Graphics,Controls,Forms, Dialogs,StdCtrls,IDHashMessageDigest,IDGlobal,IDHash,util_utf8; type TForm1 = class(TForm) btn1: Tbutton; procedure btn1Click(Sender: TObject); procedure FormCreate(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} function MD5Ecryption(source:String):string;//MD5
加密 var MyMD5:TIDHashMessageDigest5; Digest:T4x4LongWordRecord; ciphertext:String;//返回密文 begin Result := ''; MyMD5 := TIDHashMessageDigest5.Create; Digest := MyMD5.HashValue(source); ciphertext := MyMD5.AsHex(Digest); ciphertext := LowerCase(ciphertext);//密文转换为小写 Result := ciphertext; end; procedure TForm1.btn1Click(Sender: TObject); var str: string; //ffdd7738610596f36c0654d1af8e9c91 begin str := MD5Ecryption(AnsiTowIDe('百胜软件有限公司')); str := STR; end; procedure TForm1.FormCreate(Sender: TObject); var str: string; //ffdd7738610596f36c0654d1af8e9c91 // af707a26062b0c626405189f78d7f215; 这个软件的加密跟MysqL加密结果是一样的。 begin str := MD5Ecryption('百胜软件有限公司'); str := STR; end; end. 总结
以上是内存溢出为你收集整理的MD5 delPhi 加密全部内容,希望文章能够帮你解决MD5 delPhi 加密所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
评论列表(0条)