Skip to content

Password

  • Full name: \Codefy\Framework\Support\Password
  • This class is marked as final and can't be subclassed
  • This class is a Final class

Methods

algorithm

Algorithm to use when hashing the password (i.e. PASSWORD_DEFAULT, PASSWORD_ARGON2ID).

private static algorithm(): string
  • This method is static.

Return Value:

Password algorithm.

Throws:


options

An associative array containing options.

private static options(): array
  • This method is static.

Return Value:

Array of options.

Throws:


hash

Hashes a plain text password.

public static hash(string $password): string
  • This method is static.

Parameters:

Parameter Type Description
$password string Plain text password

Return Value:

Hashed password.

Throws:


verify

Checks if the given hash matches the given options.

public static verify(string $password, string $hash): bool
  • This method is static.

Parameters:

Parameter Type Description
$password string
$hash string

needsRehash

Checks if the given hash matches the given algorithm and options provider.

public static needsRehash(string $hash): bool

If not, it is assumed that the hash needs to be rehashed.

  • This method is static.

Parameters:

Parameter Type Description
$hash string

Throws:


algos

Get available password hashing algorithm IDs.

public static algos(): array
  • This method is static.

getInfo

Returns information about the given hash.

public static getInfo(string $password): array
  • This method is static.

Parameters:

Parameter Type Description
$password string


Automatically generated on 2025-10-13