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