MediaWiki  1.33.0
MWCryptRand Class Reference

Static Public Member Functions

static generate ( $bytes)
 Generate a run of cryptographically random data and return it in raw binary form. More...
 
static generateHex ( $chars)
 Generate a run of cryptographically random data and return it in hexadecimal string format. More...
 
static wasStrong ()
 Return a boolean indicating whether or not the source used for cryptographic random bytes generation in the previously run generate* call was cryptographically strong. More...
 

Static Protected Member Functions

static singleton ()
 

Detailed Description

Definition at line 29 of file MWCryptRand.php.

Member Function Documentation

◆ generate()

static MWCryptRand::generate (   $bytes)
static

Generate a run of cryptographically random data and return it in raw binary form.

Deprecated:
since 1.32, use random_bytes()
Parameters
int$bytesThe number of bytes of random data to generate
Returns
string Raw binary random data

Definition at line 62 of file MWCryptRand.php.

References wfDeprecated().

◆ generateHex()

◆ singleton()

static MWCryptRand::singleton ( )
staticprotected
Deprecated:
since 1.32
Returns
CryptRand

Definition at line 34 of file MWCryptRand.php.

References wfDeprecated().

◆ wasStrong()

static MWCryptRand::wasStrong ( )
static

Return a boolean indicating whether or not the source used for cryptographic random bytes generation in the previously run generate* call was cryptographically strong.

Deprecated:
since 1.32, always returns true
Returns
bool Always true

Definition at line 48 of file MWCryptRand.php.

References wfDeprecated().


The documentation for this class was generated from the following file: