class Argon2IdHasher extends ArgonHasher

Properties

protected int $memory

The default memory cost factor.

from  ArgonHasher
protected int $time

The default time cost factor.

from  ArgonHasher
protected int $threads

The default threads factor.

from  ArgonHasher
protected bool $verifyAlgorithm

Indicates whether to perform an algorithm check.

from  ArgonHasher

Methods

array
info(string $hashedValue)

Get information about the given hashed value.

bool
check(string $value, string|null $hashedValue, array $options = [])

Check the given plain value against a hash.

bool
hasHash(string|null $hashedValue)

Determine whether a hash value is present.

__construct(array $options = [])

Create a new hasher instance.

string
make(string $value, array $options = [])

Hash the given value.

int|string
algorithm()

Get the algorithm that should be used for hashing.

bool
needsRehash(string|null $hashedValue, array $options = [])

Check if the given hash has been hashed using the given options.

bool
verifyConfiguration(string $hashedValue)

Verifies that the configuration is less than or equal to what is configured.

bool
isUsingCorrectAlgorithm(string $hashedValue)

Verify the hashed value's algorithm.

bool
isUsingValidOptions(string $hashedValue)

Verify the hashed value's options.

setMemory(int $memory)

Set the default password memory factor.

setTime(int $time)

Set the default password timing factor.

setThreads(int $threads)

Set the default password threads factor.

int
memory(array $options)

Extract the memory cost value from the options array.

int
time(array $options)

Extract the time cost value from the options array.

int
threads(array $options)

Extract the thread's value from the options array.

Details

in AbstractHasher at line 14
array info(string $hashedValue)

Get information about the given hashed value.

Parameters

string $hashedValue

Return Value

array

at line 17
bool check(string $value, string|null $hashedValue, array $options = [])

Check the given plain value against a hash.

Parameters

string $value
string|null $hashedValue
array $options

Return Value

bool

Exceptions

RuntimeException

in AbstractHasher at line 34
protected bool hasHash(string|null $hashedValue)

Determine whether a hash value is present.

Parameters

string|null $hashedValue

Return Value

bool

in ArgonHasher at line 37
__construct(array $options = [])

Create a new hasher instance.

Parameters

array $options

in ArgonHasher at line 50
string make(string $value, array $options = [])

Hash the given value.

Parameters

string $value
array $options

Return Value

string

Exceptions

RuntimeException

at line 33
protected int|string algorithm()

Get the algorithm that should be used for hashing.

Return Value

int|string

in ArgonHasher at line 94
bool needsRehash(string|null $hashedValue, array $options = [])

Check if the given hash has been hashed using the given options.

Parameters

string|null $hashedValue
array $options

Return Value

bool

in ArgonHasher at line 112
bool verifyConfiguration(string $hashedValue)

internal  
 

Verifies that the configuration is less than or equal to what is configured.

Parameters

string $hashedValue

Return Value

bool

at line 41
protected bool isUsingCorrectAlgorithm(string $hashedValue)

Verify the hashed value's algorithm.

Parameters

string $hashedValue

Return Value

bool

in ArgonHasher at line 128
protected bool isUsingValidOptions(string $hashedValue)

Verify the hashed value's options.

Parameters

string $hashedValue

Return Value

bool

in ArgonHasher at line 159
ArgonHasher setMemory(int $memory)

Set the default password memory factor.

Boot-only. Mutates the shared hasher instance held by the HashManager; per-request use races across coroutines.

Parameters

int $memory

Return Value

ArgonHasher

in ArgonHasher at line 174
ArgonHasher setTime(int $time)

Set the default password timing factor.

Boot-only. Mutates the shared hasher instance held by the HashManager; per-request use races across coroutines.

Parameters

int $time

Return Value

ArgonHasher

in ArgonHasher at line 189
ArgonHasher setThreads(int $threads)

Set the default password threads factor.

Boot-only. Mutates the shared hasher instance held by the HashManager; per-request use races across coroutines.

Parameters

int $threads

Return Value

ArgonHasher

in ArgonHasher at line 199
protected int memory(array $options)

Extract the memory cost value from the options array.

Parameters

array $options

Return Value

int

in ArgonHasher at line 207
protected int time(array $options)

Extract the time cost value from the options array.

Parameters

array $options

Return Value

int

in ArgonHasher at line 215
protected int threads(array $options)

Extract the thread's value from the options array.

Parameters

array $options

Return Value

int