Password
Table of Contents
Methods
- equals() : bool
- Compares a hash and a(n) (original) password.
- hash() : string
- Hashes a password using SHA-512 by default.
- needRehash() : bool
- Determines if a password needs to be rehashed.
Methods
equals()
Compares a hash and a(n) (original) password.
public
static equals(string $hash, string $password[, bool $original = true ]) : bool
Parameters
- $hash : string
-
Hash of the password.
- $password : string
-
User supplied password.
- $original : bool = true
Return values
boolhash()
Hashes a password using SHA-512 by default.
public
static hash(string $password[, null|string $salt = null ]) : string
Parameters
- $password : string
- $salt : null|string = null
-
If null, will be generated
Return values
stringneedRehash()
Determines if a password needs to be rehashed.
public
static needRehash(string $hash) : bool
Parameters
- $hash : string
-
Hash of the password.