Documentation

PasswordHasherInterface

Provides password hashing capabilities.

Tags
author

Robin Chalas robin.chalas@gmail.com

author

Fabien Potencier fabien@symfony.com

author

Nicolas Grekas p@tchwork.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
Verifies a plain password against a hash.

Constants

Methods

hash()

Hashes a plain password.

public hash(string $plainPassword) : string
Parameters
$plainPassword : string
Tags
throws
InvalidPasswordException

When 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()

Verifies a plain password against a hash.

public verify(string $hashedPassword, string $plainPassword) : bool
Parameters
$hashedPassword : string
$plainPassword : string
Return values
bool

        
On this page

Search results