Dotclear  2.29
 All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Crypt Class Reference

Static Public Member Functions

static hmac (string $key, string $data, string $hashfunc= 'sha1')
 
static hmacLegacy (string $key, string $data, string $hashfunc= 'sha1')
 
static createPassword (int $length=8)
 

Detailed Description

Cryptographic helpers

Member Function Documentation

static hmac ( string  $key,
string  $data,
string  $hashfunc = 'sha1' 
)
static

SHA1 or MD5 + HMAC

Returns an HMAC encoded value of $data, using the said $key and $hashfunc as hash method (sha1 or md5 are accepted if hash_hmac function not exists.)

Parameters
string$keyHash key
string$dataData
string$hashfuncHash function (md5 or sha1)
Returns
string

Referenced by Http\browserUID(), Auth\checkUser(), and Auth\cryptLegacy().

Here is the caller graph for this function:

static hmacLegacy ( string  $key,
string  $data,
string  $hashfunc = 'sha1' 
)
static

Legacy hmac method

Parameters
string$keyThe key
string$dataThe data
string$hashfuncThe hashfunc
Returns
string
static createPassword ( int  $length = 8)
static

Password generator

Returns an n characters random password.

Parameters
integer$lengthrequired length
Returns
string

Referenced by ModuleImportDc1\importUsers(), ModuleImportWp\importUsers(), and Auth\recoverUserPassword().

Here is the caller graph for this function:


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