Random

Pure-PHP Random Number Generator

author

Jim Wigginton terrafrost@php.net

package

Default

Methods

Safely serialize variables

safe_serialize(mixed &$arr): mixed
static

If a class has a private __sleep() it'll emit a warning

Arguments

$arr

mixed

Response

mixed

Generate a random string.

string(integer $length): string
static

Although microoptimizations are generally discouraged as they impair readability this function is ripe with microoptimizations because this function has the potential of being called a huge number of times. eg. for RSA key generation.

Throws
\RuntimeException

if a symmetric cipher is needed but not loaded

Arguments

$length

integer

Response

string