function Str2MD5(const s:string):string; function MD5toString(D:MD5):string; //在MD5前面要加一个T,论坛不允许所以去掉了。 var I: byte; const Digits: array[0..15] of char = ('0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f'); begin Result := ''; for I := 0 to 15 do Result := Result + Digits[(D[I] shr 4) and $0f] + Digits[D[I] and $0f]; end; var pc:PChar; begin pc := PChar(s); Result :=MD5toString(FastMD5(pbyte(PChar(s)),Length(pc))); end;