1 | <?php |
||
45 | class URandom extends \RandomLib\AbstractSource |
||
46 | { |
||
47 | |||
48 | /** |
||
49 | * @var string The file to read from |
||
50 | */ |
||
51 | protected static $file = '/dev/urandom'; |
||
52 | |||
53 | /** |
||
54 | * Return an instance of Strength indicating the strength of the source |
||
55 | * |
||
56 | * @return \SecurityLib\Strength An instance of one of the strength classes |
||
57 | */ |
||
58 | public static function getStrength() |
||
62 | |||
63 | /** |
||
64 | * If the source is currently available. |
||
65 | * Reasons might be because the library is not installed |
||
66 | * |
||
67 | * @return bool |
||
68 | */ |
||
69 | public static function isSupported() |
||
73 | |||
74 | /** |
||
75 | * Generate a random string of the specified size |
||
76 | * |
||
77 | * @param int $size The size of the requested random string |
||
78 | * |
||
79 | * @return string A string of the requested size |
||
80 | */ |
||
81 | public function generate($size) |
||
98 | } |
||
99 |