| Conditions | 2 |
| Paths | 2 |
| Total Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 11 | public function createSignature($data, $fields, $key) |
|
| 23 | { |
||
| 24 | 11 | $signable = array(); |
|
| 25 | 11 | foreach ($fields as $field) { |
|
| 26 | 11 | $signable[] = $field.'='.$data[$field]; |
|
| 27 | } |
||
| 28 | 11 | $message = implode(',', $signable); |
|
| 29 | 11 | return base64_encode(hash_hmac('sha256', $message, $key, true)); |
|
| 30 | } |
||
| 31 | } |
||
| 32 |