編譯環境:Windows 7 +Delphi xe 10.3.2spa
封裝了快遞鳥接口,注意的坑:MD5要轉爲小寫。code
function TKDniaoAPI.StrtoMd5(const str: string): string; var AMD5: TIdHashMessageDigest5; begin AMD5 := TIdHashMessageDigest5.Create; try Result := AnsiLowerCase(AMD5.HashStringAsHex(str, IndyTextEncoding(TEncoding.UTF8))); //注意轉小寫 finally AMD5.Free; end; end;