MediaWiki REL1_33
|
Public Member Functions | |
generate ( $bytes) | |
Generate a run of cryptographically random data and return it in raw binary form. | |
generateHex ( $chars) | |
Generate a run of cryptographically random data and return it in hexadecimal string format. | |
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. | |
Public Attributes | |
const | MIN_ITERATIONS = 1000 |
const | MSEC_PER_BYTE = 0.5 |
Protected Member Functions | |
driftHash ( $data) | |
Randomly hash data while mixing in clock drift data for randomness. | |
initialRandomState () | |
Initialize an initial random state based off of whatever we can find. | |
randomState () | |
Return a rolling random state initially build using data from unstable sources. | |
Definition at line 30 of file CryptRand.php.
|
protected |
Randomly hash data while mixing in clock drift data for randomness.
string | $data | The data to randomly hash. |
Definition at line 62 of file CryptRand.php.
References wfDeprecated().
CryptRand::generate | ( | $bytes | ) |
Generate a run of cryptographically random data and return it in raw binary form.
You can use CryptRand::wasStrong() if you wish to know if the source used was cryptographically strong.
int | $bytes | The number of bytes of random data to generate |
Definition at line 102 of file CryptRand.php.
References wfDeprecated().
CryptRand::generateHex | ( | $chars | ) |
Generate a run of cryptographically random data and return it in hexadecimal string format.
int | $chars | The number of hex chars of random data to generate |
Definition at line 115 of file CryptRand.php.
References MWCryptRand\generateHex(), and wfDeprecated().
|
protected |
Initialize an initial random state based off of whatever we can find.
Definition at line 48 of file CryptRand.php.
References wfDeprecated().
|
protected |
Return a rolling random state initially build using data from unstable sources.
Definition at line 74 of file CryptRand.php.
References wfDeprecated().
CryptRand::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.
Definition at line 88 of file CryptRand.php.
References wfDeprecated().
const CryptRand::MIN_ITERATIONS = 1000 |
Definition at line 34 of file CryptRand.php.
const CryptRand::MSEC_PER_BYTE = 0.5 |
Definition at line 39 of file CryptRand.php.