SodiumPasswordHasher
in package
implements
PasswordHasherInterface
Uses
CheckPasswordLengthTrait
FinalYes
Hashes passwords using libsodium.
Tags
Table of Contents
Interfaces
- PasswordHasherInterface
- Provides password hashing capabilities.
Properties
Methods
- __construct() : mixed
- hash() : string
- Hashes a plain password.
- isSupported() : bool
- needsRehash() : bool
- Checks if a password hash would benefit from rehashing.
- verify() : bool
- Verifies a plain password against a hash.
- isPasswordTooLong() : bool
Properties
$memLimit
private
int
$memLimit
$opsLimit
private
int
$opsLimit
Methods
__construct()
public
__construct([int $opsLimit = null ][, int $memLimit = null ]) : mixed
Parameters
- $opsLimit : int = null
- $memLimit : int = null
hash()
Hashes a plain password.
public
hash(string $plainPassword) : string
Parameters
- $plainPassword : string
Return values
stringisSupported()
public
static isSupported() : bool
Return values
boolneedsRehash()
Checks if a password hash would benefit from rehashing.
public
needsRehash(string $hashedPassword) : bool
Parameters
- $hashedPassword : string
Return values
boolverify()
Verifies a plain password against a hash.
public
verify(string $hashedPassword, string $plainPassword) : bool
Parameters
- $hashedPassword : string
- $plainPassword : string
Return values
boolisPasswordTooLong()
private
isPasswordTooLong(string $password) : bool
Parameters
- $password : string