mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-30 20:59:14 +00:00
Merge branch '1.0-travis-exp' into 2.0-travis-exp
This commit is contained in:
commit
2f3c9197d9
@ -45,6 +45,10 @@ class Random
|
|||||||
*/
|
*/
|
||||||
static function string($length)
|
static function string($length)
|
||||||
{
|
{
|
||||||
|
if (!$length) {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
|
||||||
if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
|
if (version_compare(PHP_VERSION, '7.0.0', '>=')) {
|
||||||
try {
|
try {
|
||||||
return \random_bytes($length);
|
return \random_bytes($length);
|
||||||
|
Loading…
Reference in New Issue
Block a user