PHP Class Nette\Security\Passwords

Inheritance: use trait Nette\StaticClass
Show file Open project: nette/security Class Usage Examples

Public Methods

Method Description
hash ( $password, array $options = [] ) : string Computes salted password hash.
needsRehash ( $hash, array $options = [] ) : boolean Checks if the given hash matches the options.
verify ( $password, $hash ) : boolean Verifies that a password matches a hash.

Method Details

hash() public static method

Computes salted password hash.
public static hash ( $password, array $options = [] ) : string
$options array
return string 60 chars long

needsRehash() public static method

Checks if the given hash matches the options.
public static needsRehash ( $hash, array $options = [] ) : boolean
$options array
return boolean

verify() public static method

Verifies that a password matches a hash.
public static verify ( $password, $hash ) : boolean
return boolean