| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 32 | public static function unmask(string $maskedToken): string |
||
| 33 | { |
||
| 34 | $decoded = StringHelper::base64UrlDecode($maskedToken); |
||
| 35 | $length = StringHelper::byteLength($decoded) / 2; |
||
| 36 | // Check if the masked token has an even length. |
||
| 37 | if (!is_int($length)) { |
||
|
|
|||
| 38 | return ''; |
||
| 39 | } |
||
| 40 | |||
| 41 | return StringHelper::byteSubstr($decoded, $length, $length) ^ StringHelper::byteSubstr($decoded, 0, $length); |
||
| 42 | } |
||
| 44 |