SodiumPasswordEncoder
in package
implements
PasswordEncoderInterface, SelfSaltingEncoderInterface
Hashes passwords using libsodium.
Tags
Interfaces, Classes, Traits and Enums
- PasswordEncoderInterface
- PasswordEncoderInterface is the interface for all encoders.
- SelfSaltingEncoderInterface
- SelfSaltingEncoderInterface is a marker interface for encoders that do not require a user-generated salt.
Table of Contents
- MAX_PASSWORD_LENGTH = 4096
- $memLimit : mixed
- $opsLimit : mixed
- __construct() : mixed
- encodePassword() : string
- Encodes the raw password.
- isPasswordValid() : bool
- Checks a raw password against an encoded password.
- isSupported() : bool
- needsRehash() : bool
- {@inheritdoc}
Constants
MAX_PASSWORD_LENGTH
private
mixed
MAX_PASSWORD_LENGTH
= 4096
Properties
$memLimit
private
mixed
$memLimit
$opsLimit
private
mixed
$opsLimit
Methods
__construct()
public
__construct([int $opsLimit = null ][, int $memLimit = null ]) : mixed
Parameters
- $opsLimit : int = null
- $memLimit : int = null
Return values
mixed —encodePassword()
Encodes the raw password.
public
encodePassword(mixed $raw, mixed $salt) : string
Parameters
- $raw : mixed
-
The password to encode
- $salt : mixed
-
The salt
Return values
string —The encoded password
isPasswordValid()
Checks a raw password against an encoded password.
public
isPasswordValid(mixed $encoded, mixed $raw, mixed $salt) : bool
Parameters
- $encoded : mixed
-
An encoded password
- $raw : mixed
-
A raw password
- $salt : mixed
-
The salt
Return values
bool —true if the password is valid, false otherwise
isSupported()
public
static isSupported() : bool
Return values
bool —needsRehash()
{@inheritdoc}
public
needsRehash(string $encoded) : bool
Parameters
- $encoded : string