mirror of
https://github.com/danog/phpseclib.git
synced 2024-12-04 02:28:06 +01:00
Random: $urandom -> $fp
This commit is contained in:
parent
46baf1815f
commit
5ce9ad6a42
@ -90,7 +90,7 @@ function crypt_random_string($length) {
|
|||||||
$fp = @fopen('/dev/urandom', 'rb');
|
$fp = @fopen('/dev/urandom', 'rb');
|
||||||
}
|
}
|
||||||
if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource()
|
if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource()
|
||||||
return fread($urandom, $length);
|
return fread($fp, $length);
|
||||||
}
|
}
|
||||||
// method 3. pretty much does the same thing as method 2 per the following url:
|
// method 3. pretty much does the same thing as method 2 per the following url:
|
||||||
// https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391
|
// https://github.com/php/php-src/blob/7014a0eb6d1611151a286c0ff4f2238f92c120d6/ext/mcrypt/mcrypt.c#L1391
|
||||||
|
Loading…
Reference in New Issue
Block a user