Documentation

SodiumPasswordHasher
in package
implements PasswordHasherInterface Uses CheckPasswordLengthTrait

FinalYes

Hashes passwords using libsodium.

Tags
author

Robin Chalas robin.chalas@gmail.com

author

Zan Baldwin hello@zanbaldwin.com

author

Dominik Müller dominik.mueller@jkweb.ch

Table of Contents

Interfaces

PasswordHasherInterface
Provides password hashing capabilities.

Properties

$memLimit  : int
$opsLimit  : int

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

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
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

isPasswordTooLong()

private isPasswordTooLong(string $password) : bool
Parameters
$password : string
Return values
bool

        
On this page

Search results