1
0
mirror of https://github.com/danog/phpseclib.git synced 2024-12-12 00:59:48 +01:00

Random: replace user_error with exception

This commit is contained in:
terrafrost 2015-07-18 00:50:59 -05:00
parent 0565700461
commit 081f2cb825

View File

@ -49,6 +49,7 @@ class Random
* eg. for RSA key generation.
*
* @param Integer $length
* @throws \RuntimeException if a symmetric cipher is needed but not loaded
* @return String
*/
public static function string($length)
@ -199,8 +200,7 @@ class Random
$crypto = new RC4();
break;
default:
user_error(__CLASS__ . ' requires at least one symmetric cipher be loaded');
return false;
throw new \RuntimeException(__CLASS__ . ' requires at least one symmetric cipher be loaded');
}
$crypto->setKey($key);