Argon2IdHasher
extends AbstractArgon2Hasher
in package
Pop Crypt Argon2ID hasher
Tags
Table of Contents
Properties
- $memoryCost : int
- Memory cost
- $threads : int
- Threads
- $timeCost : int
- Time cost
Methods
- __construct() : mixed
- Constructor
- create() : static
- Create hasher object with options
- createHash() : string
- Create hashed value
- getAlgorithms() : array<string|int, mixed>
- Get available hashing algorithms
- getInfo() : array<string|int, mixed>
- Get info from hashed value
- getMemoryCost() : int
- Get memory cost
- getThreads() : int
- Get threads
- getTimeCost() : int
- Get time cost
- hasMemoryCost() : bool
- Has memory cost
- hasThreads() : bool
- Has threads
- hasTimeCost() : bool
- Has time cost
- make() : string
- Make hashed value (based on the hasher class)
- needsRehash() : bool
- Determine if the hashed value needs to be re-hashed
- requiresRehash() : bool
- Determine if the hashed value requires re-hashing (based on the hasher class)
- setMemoryCost() : static
- Set memory cost
- setOptions() : static
- Set hasher options
- setThreads() : static
- Set threads
- setTimeCost() : static
- Set time cost
- verify() : bool
- Verify hash
Properties
$memoryCost
Memory cost
protected
int
$memoryCost
= PASSWORD_ARGON2_DEFAULT_MEMORY_COST
$threads
Threads
protected
int
$threads
= PASSWORD_ARGON2_DEFAULT_THREADS
$timeCost
Time cost
protected
int
$timeCost
= PASSWORD_ARGON2_DEFAULT_TIME_COST
Methods
__construct()
Constructor
public
__construct([int $memoryCost = PASSWORD_ARGON2_DEFAULT_MEMORY_COST ][, int $timeCost = PASSWORD_ARGON2_DEFAULT_TIME_COST ][, int $threads = PASSWORD_ARGON2_DEFAULT_THREADS ]) : mixed
Instantiate the Argon2 object
Parameters
- $memoryCost : int = PASSWORD_ARGON2_DEFAULT_MEMORY_COST
- $timeCost : int = PASSWORD_ARGON2_DEFAULT_TIME_COST
- $threads : int = PASSWORD_ARGON2_DEFAULT_THREADS
create()
Create hasher object with options
public
static create([array<string|int, mixed> $options = [] ]) : static
Parameters
- $options : array<string|int, mixed> = []
Return values
staticcreateHash()
Create hashed value
public
createHash(string $value, string|int|null $algorithm[, array<string|int, mixed> $options = [] ]) : string
Parameters
- $value : string
- $algorithm : string|int|null
- $options : array<string|int, mixed> = []
Return values
stringgetAlgorithms()
Get available hashing algorithms
public
getAlgorithms() : array<string|int, mixed>
Return values
array<string|int, mixed>getInfo()
Get info from hashed value
public
getInfo(string $hashedValue) : array<string|int, mixed>
Parameters
- $hashedValue : string
Return values
array<string|int, mixed>getMemoryCost()
Get memory cost
public
getMemoryCost() : int
Return values
intgetThreads()
Get threads
public
getThreads() : int
Return values
intgetTimeCost()
Get time cost
public
getTimeCost() : int
Return values
inthasMemoryCost()
Has memory cost
public
hasMemoryCost() : bool
Return values
boolhasThreads()
Has threads
public
hasThreads() : bool
Return values
boolhasTimeCost()
Has time cost
public
hasTimeCost() : bool
Return values
boolmake()
Make hashed value (based on the hasher class)
public
make(string $value) : string
Parameters
- $value : string
Return values
stringneedsRehash()
Determine if the hashed value needs to be re-hashed
public
needsRehash(string $hashedValue, string|int|null $algorithm[, array<string|int, mixed> $options = [] ]) : bool
Parameters
- $hashedValue : string
- $algorithm : string|int|null
- $options : array<string|int, mixed> = []
Return values
boolrequiresRehash()
Determine if the hashed value requires re-hashing (based on the hasher class)
public
requiresRehash(string $hashedValue) : bool
Parameters
- $hashedValue : string
Return values
boolsetMemoryCost()
Set memory cost
public
setMemoryCost(int $memoryCost) : static
Parameters
- $memoryCost : int
Return values
staticsetOptions()
Set hasher options
public
setOptions(array<string|int, mixed> $options) : static
Parameters
- $options : array<string|int, mixed>
Return values
staticsetThreads()
Set threads
public
setThreads(int $threads) : static
Parameters
- $threads : int
Return values
staticsetTimeCost()
Set time cost
public
setTimeCost(int $timeCost) : static
Parameters
- $timeCost : int
Return values
staticverify()
Verify hash
public
verify(string $value, string $hashedValue) : bool
Parameters
- $value : string
- $hashedValue : string