| Total Complexity | 2 |
| Total Lines | 24 |
| Duplicated Lines | 0 % |
| Coverage | 80% |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 28 | class Tiqr_Random |
||
| 29 | { |
||
| 30 | /** |
||
| 31 | * Generate $length cryptographically secure pseudo-random bytes |
||
| 32 | * Throws when requested number of bytes cannot be generated |
||
| 33 | * |
||
| 34 | * Note that this function generates random BYTES, it uses the string type as an array of bytes with values |
||
| 35 | * from 0 to 255. |
||
| 36 | * |
||
| 37 | * @param int $length the number of bytes to generate. |
||
| 38 | * @return string containing $length cryptographically secure pseudo-random bytes |
||
| 39 | * |
||
| 40 | * @throws Exception, Error, TypeError |
||
| 41 | */ |
||
| 42 | 34 | public static function randomBytes(int $length): string |
|
| 54 | } |