(int $len = 6)
| 12 | final class SourceHealth |
| 13 | { |
| 14 | private static function randomToken(int $len = 6): string |
| 15 | { |
| 16 | $size = max(4, $len); |
| 17 | try { |
| 18 | return substr(bin2hex(random_bytes($size)), 0, $size); |
| 19 | } catch (Throwable $e) { |
| 20 | return substr(md5((string)microtime(true) . ':' . (string)mt_rand()), 0, $size); |
| 21 | } |
| 22 | } |
| 23 | |
| 24 | private static function joinPath(string $base, string $child): string |
| 25 | { |