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