public static function buildSignature($stringToSign, $secretKey) { return base64_encode(hash_hmac("sha256", $stringToSign, $secretKey, true)); }
public function testSignature() { $expectedResult = "9hUgcq4Tnuwb9naeMAyL/Xnk070qcbQUfSbWsFBztgM="; $this->assertEquals($expectedResult, Util::buildSignature('ABCD', 'EFG')); }