PasswordHashFactory
Read onlyYes
Factory class to find and return hash instances of given hashed passwords and to find and return default hash instances to hash new passwords.
Table of Contents
Methods
- get() : PasswordHashInterface
- Find a hash class that handles given hash and return an instance of it.
- getDefaultHashInstance() : PasswordHashInterface
- Determine configured default hash method and return an instance of the class representing it.
- getRegisteredSaltedHashingMethods() : array<string|int, mixed>
- Returns list of all registered hashing methods. Used eg. in extension configuration to select the default hashing method.
Methods
get()
Find a hash class that handles given hash and return an instance of it.
public
get(string $hash, string $mode) : PasswordHashInterface
Parameters
- $hash : string
-
Given hash to find instance for
- $mode : string
-
'FE' for frontend users, 'BE' for backend users
Tags
Return values
PasswordHashInterface —Object that can handle given hash
getDefaultHashInstance()
Determine configured default hash method and return an instance of the class representing it.
public
getDefaultHashInstance(string $mode) : PasswordHashInterface
Parameters
- $mode : string
-
'FE' for frontend users, 'BE' for backend users
Tags
Return values
PasswordHashInterface —Class instance that is configured as default hash method
getRegisteredSaltedHashingMethods()
Returns list of all registered hashing methods. Used eg. in extension configuration to select the default hashing method.
public
static getRegisteredSaltedHashingMethods() : array<string|int, mixed>