mediatekformation

NativePasswordEncoder
in package
implements PasswordEncoderInterface, SelfSaltingEncoderInterface

Hashes passwords using password_hash().

Tags
author

Elnur Abdurrakhimov elnur@elnur.pro

author

Terje Bråten terje@braten.be

author

Nicolas Grekas p@tchwork.com

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
$algo  : mixed
$options  : mixed
__construct()  : mixed
encodePassword()  : string
Encodes the raw password.
isPasswordValid()  : bool
Checks a raw password against an encoded password.
needsRehash()  : bool
{@inheritdoc}

Constants

Properties

Methods

__construct()

public __construct([int $opsLimit = null ][, int $memLimit = null ][, int $cost = null ][, string|null $algo = null ]) : mixed
Parameters
$opsLimit : int = null
$memLimit : int = null
$cost : int = null
$algo : string|null = null

An algorithm supported by password_hash() or null to use the stronger available algorithm

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

needsRehash()

{@inheritdoc}

public needsRehash(string $encoded) : bool
Parameters
$encoded : string
Return values
bool

Search results