array ( 0 => 'index.php', 1 => 'PHP Manual', ), 'head' => array ( 0 => 'UTF-8', 1 => 'es', ), 'this' => array ( 0 => 'class.random-engine-secure.php', 1 => 'Random\\Engine\\Secure', ), 'up' => array ( 0 => 'book.random.php', 1 => 'Random', ), 'prev' => array ( 0 => 'class.random-cryptosafeengine.php', 1 => 'Random\\CryptoSafeEngine', ), 'next' => array ( 0 => 'random-engine-secure.generate.php', 1 => 'Random\\Engine\\Secure::generate', ), 'alternatives' => array ( ), 'source' => array ( 'lang' => 'en', 'path' => 'reference/random/random.engine.secure.xml', ), 'extra_header_links' => array ( 'rel' => 'alternate', 'href' => '/manual/en/feeds/class.random-engine-secure.atom', 'type' => 'application/atom+xml', ), ); $setup["toc"] = $TOC; $setup["toc_deprecated"] = $TOC_DEPRECATED; $setup["parents"] = $PARENTS; manual_setup($setup); ?>
(PHP 8 >= 8.2.0)
Generates cryptographically secure randomness using the operating system’s CSPRNG.
The randomness generated by this Random\Engine is suitable for all applications, including the generation of long-term secrets, such as encryption keys.
The Random\Engine\Secure engine is the recommended safe default choice, unless the application requires either reproducible sequences or very high performance.