Conditions | 1 |
Paths | 1 |
Total Lines | 8 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 1 |
Changes | 0 |
1 | <?php |
||
27 | 1 | public function asArray(Header $header, array $requestData, $path, $nonce) |
|
28 | { |
||
29 | 1 | $requestData["nonce"] = $nonce; |
|
30 | 1 | $postData = http_build_query($requestData, '', '&'); |
|
31 | 1 | $sign = hash_hmac('sha512', $path . hash('sha256', $nonce . $postData, true), |
|
32 | 1 | base64_decode($header->getApiSign()), true); |
|
33 | |||
34 | 1 | return ["API-Key" => $header->getApiKey(), "API-Sign" => base64_encode($sign)]; |
|
35 | } |
||
37 |