Total Complexity | 3 |
Total Lines | 28 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
14 | trait HMACOutputLengthTrait |
||
15 | { |
||
16 | /** |
||
17 | * The HMAC algorithm (RFC2104 [HMAC]) takes the output (truncation) length in bits as a parameter; |
||
18 | * this specification REQUIRES that the truncation length be a multiple of 8 (i.e. fall on a byte boundary) |
||
19 | * because Base64 encoding operates on full bytes |
||
20 | * |
||
21 | * @var string |
||
22 | */ |
||
23 | private static string $HMACOutputLength_regex = '/^([1-9]\d+)$/D'; |
||
24 | |||
25 | |||
26 | /** |
||
27 | * @param string $value |
||
28 | * @param string $message |
||
29 | */ |
||
30 | protected static function validHMACOutputLength(string $value, string $message = ''): void |
||
45 |