mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-09 15:20:58 +00:00
Random: replace user_error with exception
This commit is contained in:
parent
0565700461
commit
081f2cb825
@ -49,6 +49,7 @@ class Random
|
|||||||
* eg. for RSA key generation.
|
* eg. for RSA key generation.
|
||||||
*
|
*
|
||||||
* @param Integer $length
|
* @param Integer $length
|
||||||
|
* @throws \RuntimeException if a symmetric cipher is needed but not loaded
|
||||||
* @return String
|
* @return String
|
||||||
*/
|
*/
|
||||||
public static function string($length)
|
public static function string($length)
|
||||||
@ -199,8 +200,7 @@ class Random
|
|||||||
$crypto = new RC4();
|
$crypto = new RC4();
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded');
|
throw new \RuntimeException(__CLASS__ . ' requires at least one symmetric cipher be loaded');
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$crypto->setKey($key);
|
$crypto->setKey($key);
|
||||||
|
Loading…
Reference in New Issue
Block a user