Documentation

LegacyPasswordHasherInterface extends PasswordHasherInterface

Provides password hashing and verification capabilities for "legacy" hashers that require external salts.

Tags
author

Fabien Potencier fabien@symfony.com

author

Nicolas Grekas p@tchwork.com

author

Robin Chalas robin.chalas@gmail.com

Table of Contents

Constants

MAX_PASSWORD_LENGTH  = 4096

Methods

hash()  : string
Hashes a plain password.
needsRehash()  : bool
Checks if a password hash would benefit from rehashing.
verify()  : bool
Checks that a plain password and a salt match a password hash.

Constants

Methods

hash()

Hashes a plain password.

public hash(string $plainPassword[, string $salt = null ]) : string
Parameters
$plainPassword : string
$salt : string = null
Tags
throws
InvalidPasswordException

If the plain password is invalid, e.g. excessively long

Return values
string

needsRehash()

Checks if a password hash would benefit from rehashing.

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

verify()

Checks that a plain password and a salt match a password hash.

public verify(string $hashedPassword, string $plainPassword[, string $salt = null ]) : bool
Parameters
$hashedPassword : string
$plainPassword : string
$salt : string = null
Return values
bool

        
On this page

Search results