ApaiIO\Request\Util::buildSignature PHP 메소드

buildSignature() 공개 정적인 메소드

Provides the signature
public static buildSignature ( string $stringToSign, string $secretKey ) : string
$stringToSign string The string to be signed
$secretKey string The paapi secret key
리턴 string
    public static function buildSignature($stringToSign, $secretKey)
    {
        return base64_encode(hash_hmac("sha256", $stringToSign, $secretKey, true));
    }

Usage Example

예제 #1
0
 public function testSignature()
 {
     $expectedResult = "9hUgcq4Tnuwb9naeMAyL/Xnk070qcbQUfSbWsFBztgM=";
     $this->assertEquals($expectedResult, Util::buildSignature('ABCD', 'EFG'));
 }
All Usage Examples Of ApaiIO\Request\Util::buildSignature