class Argon2id extends Hasher

Argon2id hasher.

Properties

protected array $options Algorithm options. from Hasher

Methods

__construct(array $options = [])

Constructor.

from Hasher
array
normalizeOptions(array $options)

Normalizes the algorithm options.

from Hasher
int|string
getAlgorithm()

Returns the algorithm type.

string
create(string $password)

Creates a password hash.

from Hasher
bool
verify(string $password, string $hash)

Verifies that the password matches the hash.

from Hasher
bool
needsRehash(string $hash)

Returns true if the password needs rehashing and false if not.

from Hasher

Details

in Hasher at line 33
__construct(array $options = [])

Constructor.

Parameters

array $options algorithm options

in Hasher at line 44
protected array normalizeOptions(array $options)

Normalizes the algorithm options.

Parameters

array $options Algorithm options

Return Value

array

at line 20
protected int|string getAlgorithm()

Returns the algorithm type.

Return Value

int|string

in Hasher at line 59
string create(string $password)

Creates a password hash.

Parameters

string $password Password

Return Value

string

Exceptions

HasherException

in Hasher at line 74
bool verify(string $password, string $hash)

Verifies that the password matches the hash.

Parameters

string $password Password
string $hash Hash

Return Value

bool

in Hasher at line 82
bool needsRehash(string $hash)

Returns true if the password needs rehashing and false if not.

Parameters

string $hash Hash

Return Value

bool