Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Référence de la classe FOFEncryptRandval
+ Graphe d'héritage de FOFEncryptRandval:

Fonctions membres publiques

 generate ($bytes=32)
 
 genRandomBytes ($length=32)
 
- Fonctions membres publiques hérités de FOFEncryptRandvalinterface
 generate ()
 

Description détaillée

Generates cryptographically-secure random values.

Documentation des fonctions membres

◆ generate()

generate (   $bytes = 32)

Returns a cryptographically secure random value.

Since we only run on PHP 7+ we can use random_bytes(), which internally uses a crypto safe PRNG. If the function doesn't exist, Joomla already loads a secure polyfill.

The reason this method exists is backwards compatibility with older versions of FOF. It also allows us to quickly address any future issues if Joomla drops the polyfill or otherwise find problems with PHP's random_bytes() on some weird host (you can't be too careful when releasing mass-distributed software).

Paramètres
integer$bytesHow many bytes to return
Renvoie
string

◆ genRandomBytes()

genRandomBytes (   $length = 32)

Generate random bytes. Adapted from Joomla! 3.2.

Since we only run on PHP 7+ we can use random_bytes(), which internally uses a crypto safe PRNG. If the function doesn't exist, Joomla already loads a secure polyfill.

The reason this method exists is backwards compatibility with older versions of FOF. It also allows us to quickly address any future issues if Joomla drops the polyfill or otherwise find problems with PHP's random_bytes() on some weird host (you can't be too careful when releasing mass-distributed software).

Paramètres
integer$lengthLength of the random data to generate
Renvoie
string Random binary data

La documentation de cette classe a été générée à partir du fichier suivant :