page-login.php
Table of Contents
- do_password_hash_code_update() : mixed
- Recalculates and updates the password hashing cost.
- hash_password_properties() : array<string|int, mixed>
- Figures out the appropriate algorithm & options for hashing passwords based on the current settings.
- hash_password() : string
- Hashes the given password according to the current settings defined in $settings.
- verify_password() : bool
- Verifies a user's password against a pre-generated hash.
- hash_password_update() : string|null
- Determines if the provided password needs re-hashing or not.
- hash_password_compute_cost() : int
- Computes the appropriate cost value for password_hash based on the settings automatically.
Functions
do_password_hash_code_update()
Recalculates and updates the password hashing cost.
do_password_hash_code_update() : mixed
Return values
mixed —hash_password_properties()
Figures out the appropriate algorithm & options for hashing passwords based on the current settings.
hash_password_properties() : array<string|int, mixed>
Return values
array<string|int, mixed> —The appropriate password hashing algorithm and options.
hash_password()
Hashes the given password according to the current settings defined in $settings.
hash_password(string $pass) : string
Parameters
- $pass : string
-
The password to hash.
Return values
string —The hashed password. Uses password_hash() under-the-hood, but with some additional extras to avoid known issues.
verify_password()
Verifies a user's password against a pre-generated hash.
verify_password(string $pass, string $hash) : bool
Parameters
- $pass : string
-
The user's password.
- $hash : string
-
The hash to compare against.
Return values
bool —Whether the password matches the has or not.
hash_password_update()
Determines if the provided password needs re-hashing or not.
hash_password_update(string $pass, string $hash) : string|null
Parameters
- $pass : string
-
The password to check.
- $hash : string
-
The hash of the provided password to check.
Return values
string|null —Returns null if an updaste is not required - otherwise returns the new updated hash.
hash_password_compute_cost()
Computes the appropriate cost value for password_hash based on the settings automatically.
hash_password_compute_cost([bool $verbose = false ]) : int
Starts at 10 and works upwards in increments of 1. Goes on until a value is found that's greater than the target - or 10x the target time elapses.
Parameters
- $verbose : bool = false
-
Whether to output verbose progress information to the client or not.
Return values
int —The automatically calculated password hashing cost.