MediaWiki master
MWCryptRand Class Reference

A cryptographic random generator class used for generating secret keys. More...

Static Public Member Functions

static generateHex ( $chars)
 Generate a run of cryptographically random data and return it in hexadecimal string format.
 

Detailed Description

A cryptographic random generator class used for generating secret keys.

Note
GPL-2.0-or-later
Author
Daniel Friesen

This is based in part on Drupal code as well as what we used in our own code prior to introduction of this class.

Definition at line 13 of file MWCryptRand.php.

Member Function Documentation

◆ generateHex()

static MWCryptRand::generateHex ( $chars)
static

Generate a run of cryptographically random data and return it in hexadecimal string format.

Parameters
int$charsThe number of hex chars of random data to generate
Returns
string Hexadecimal random data

Definition at line 22 of file MWCryptRand.php.


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