CoreFiles by mySites.guru
Randval.php33 lines, 846 bytes, from Joomla_4.2.0-Stable-Full_Package.zip
Raw History Compare with 4.1.5
md5
a6bf5b1fce605afe2081e8ca67e1a863
sha1
8e6246fedbe2a87588b8d176056cdc89b62f0bd8
sha256
6f02c93c8c2d93ed39fab13cc73c56117d716d8177c06e455f7e05027a56dd56
<?php

/**
 * Joomla! Content Management System
 *
 * @copyright  (C) 2016 Open Source Matters, Inc. <https://www.joomla.org>
 * @license    GNU General Public License version 2 or later; see LICENSE.txt
 */

namespace Joomla\CMS\Encrypt;

/**
 * Generates cryptographically-secure random values.
 *
 * @since    4.0.0
 */
class Randval implements RandValInterface
{
    /**
     * Returns a cryptographically secure random value.
     *
     * This method allows us to quickly address any future issues if we ever find problems with PHP's random_bytes() on
     * some weird host (you can't be too careful when releasing mass-distributed software).
     *
     * @param   integer  $bytes  How many bytes to return
     *
     * @return  string
     */
    public function generate($bytes = 32)
    {
        return random_bytes($bytes);
    }
}

The same content is in 5 releases, Joomla 4.2.0-beta3 to 4.2.1-rc2. See them all, or every version of this file.