API - XOOPS 2.5.11 Beta 2
By monxoops.fr
Random Class Reference

Static Public Member Functions

static generateOneTimeToken ($hash='sha512', $bytes=64)
 
static generateKey ($hash='sha512', $bytes=128)
 

Member Function Documentation

◆ generateKey()

static generateKey (   $hash = 'sha512',
  $bytes = 128 
)
static

Create a medium strength key

Generates a medium strength random number of size $bytes and hash with the algorithm specified in $hash.

Parameters
string$hashhash function to use
integer$bytesthe number of random bytes to generate
Returns
string hashed token
Exceptions

Exception on insufficient entropy

Here is the caller graph for this function:

◆ generateOneTimeToken()

static generateOneTimeToken (   $hash = 'sha512',
  $bytes = 64 
)
static

Create a one time token

Generates a low strength random number of size $bytes and hash with the algorithm specified in $hash.

Parameters
string$hashhash function to use
integer$bytesthe number of random bit to generate
Returns
string hashed token
Exceptions

Exception on insufficient entropy


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