Conditions | 1 |
Paths | 1 |
Total Lines | 5 |
Code Lines | 2 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 1 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php declare(strict_types=1); |
||
20 | 5 | public static function mask(string $token): string |
|
21 | { |
||
22 | // The number of bytes in a mask is always equal to the number of bytes in a token. |
||
23 | 5 | $mask = random_bytes(StringHelper::byteLength($token)); |
|
24 | 4 | return StringHelper::base64UrlEncode($mask . ($mask ^ $token)); |
|
25 | } |
||
44 |