$hash = hash_hmac("sha1", ('GET&'.rawurlencode($Url).'&'.rawurlencode($CanShu)), $SecretOAuthKey.'&', TRUE);php 有hash_hmac函数 求delphi 版

解决方案 »

  1.   

    http://code.google.com/p/fundamentals/source/browse/trunk/Source/Utils/cHash.pas?r=30
      

  2.   

    CSDN 都是 delphi 低手吗  Delphi 绝种了 各大语言都 有这个函数 delphi 却没有 天亡delphi
      

  3.   

    冲LZ的头像,得回帖。
    请查阅indy组件
      

  4.   

    Indy组件里就有
    function TBaseApp.HashSha1Str(const AStr: string): string;
    var
      bs: TBytes;
      i : Integer;
    begin
      with TIdHashSHA1.Create do
      try
        bs := HashString(AStr);
      finally
        Free;
      end;  Result  :=  '';
      for i := Low(bs) to High(bs) do
        Result  :=  Result + IntToHex(bs[i], 2);
      Result  :=  LowerCase(Result);
    end;
      

  5.   

    string hash_hmac ( string $algo , string $data , string $key [, bool $raw_output = false ] )
    是data 和 key 两个参数 并非单纯的sha1加密php官方: http://php.net/manual/en/function.hash-hmac.php
    =========================================
    PHP 有 sha1加密函数: sha1();delphi 也有sha1加密 
    我要的是这个hash_hmac()函数的delphi版  
    =====================================
    hash_hmac() 是有两个参数的 data 和 key