| Total Complexity | 4 |
| Total Lines | 26 |
| Duplicated Lines | 0 % |
| Coverage | 87.5% |
| Changes | 0 | ||
| 1 | <?php |
||
| 16 | final class HmacSha extends Signature |
||
| 17 | { |
||
| 18 | /** |
||
| 19 | * @var string hash algorithm, e.g. `sha1`, `sha256` and so on. |
||
| 20 | * |
||
| 21 | * @link https://php.net/manual/ru/function.hash-algos.php |
||
| 22 | */ |
||
| 23 | private string $algorithm; |
||
| 24 | |||
| 25 | 3 | public function __construct(string $algorithm) |
|
| 32 | } |
||
| 33 | |||
| 34 | 2 | public function getName(): string |
|
| 35 | { |
||
| 36 | 2 | return 'HMAC-' . strtoupper($this->algorithm); |
|
| 37 | } |
||
| 38 | |||
| 39 | 3 | public function generateSignature(string $baseString, string $key): string |
|
| 42 | } |
||
| 43 | } |
||
| 44 |