Copied!

PasswordHashService

PasswordHashService.php : 11

Methods

publiccreatePasswordHash()

PasswordHashService.php : 37

Create hash from given plain password.

public createPasswordHash(string $plainPassword[, int|null $hashType = null ]) : string

If non-provided, the default password hash type will be used.

Parameters

Name Type Default value Description
$plainPassword string - -
$hashType int|null null -

Return values

string

publicgetDefaultHashType()

PasswordHashService.php : 18

Returns default password hash type.

public getDefaultHashType() : int

Return values

int

publicgetSupportedHashTypes()

PasswordHashService.php : 25

Returns list of supported password hash types.

public getSupportedHashTypes() : array<string|int, int>

Return values

array<string|int, int>

publicisHashTypeSupported()

PasswordHashService.php : 30

Shortcut method to check if given hash type is supported.

public isHashTypeSupported(int $hashType) : bool

Parameters

Name Type Default value Description
$hashType int - -

Return values

bool

publicisValidPassword()

PasswordHashService.php : 44

Validates given $plainPassword against $passwordHash.

public isValidPassword(string $plainPassword, string $passwordHash[, int|null $hashType = null ]) : bool

If non-provided, the default password hash type will be used.

Parameters

Name Type Default value Description
$plainPassword string - -
$passwordHash string - -
$hashType int|null null -

Return values

bool