Conditions | 2 |
Paths | 2 |
Total Lines | 10 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
40 | 6 | public static function remove(string $maskedToken): string |
|
41 | { |
||
42 | 6 | $decoded = StringHelper::base64UrlDecode($maskedToken); |
|
43 | 6 | $length = StringHelper::byteLength($decoded) / 2; |
|
44 | // Check if the masked token has an even length. |
||
45 | 6 | if (!is_int($length)) { |
|
|
|||
46 | 1 | return ''; |
|
47 | } |
||
48 | |||
49 | 5 | return StringHelper::byteSubstring($decoded, $length, $length) ^ StringHelper::byteSubstring($decoded, 0, $length); |
|
50 | } |
||
52 |