PHP Class Gdn_PasswordHash, vanilla

Inheritance: extends PasswordHash
Afficher le fichier Open project: vanilla/vanilla Class Usage Examples

Méthodes publiques

Свойство Type Description
$Weak boolean
$portable_hashes boolean

Protected Properties

Свойство Type Description
$algorithms array

Méthodes publiques

Méthode Description
checkPassword ( string $Password, string $StoredHash, boolean | string $Method = false ) : boolean Check a password against a stored password.
hashPassword ( string $password ) : string Create a password hash.
hashPasswordPhpass ( string $password ) : string Create a password hash using Phpass's algorithm.

Méthodes protégées

Méthode Description
checkYAF ( string $Password, string $StoredHash ) : boolean Check a YAF hash.
getAlgorithm ( string $algorithm ) : object Grab an instance of a valid password algorithm.

Method Details

checkPassword() public méthode

The stored password can be plain, a md5 hash or a phpass hash. If the password wasn't a phppass hash, the Weak property is set to **true**.
public checkPassword ( string $Password, string $StoredHash, boolean | string $Method = false ) : boolean
$Password string The plaintext password to check.
$StoredHash string The password hash stored in the database.
$Method boolean | string The password hashing method.
Résultat boolean Returns **true** if the password matches the hash or **false** if it doesn't.

checkYAF() protected méthode

Check a YAF hash.
protected checkYAF ( string $Password, string $StoredHash ) : boolean
$Password string The plaintext password to check.
$StoredHash string The password hash stored in the database.
Résultat boolean Returns **true** if the password matches the hash or **false** if it doesn't.

getAlgorithm() protected méthode

Grab an instance of a valid password algorithm.
protected getAlgorithm ( string $algorithm ) : object
$algorithm string
Résultat object

hashPassword() public méthode

This method tries to use PHP's built in {@link password_hash()} function and falls back to the default implementation if that's not possible.
public hashPassword ( string $password ) : string
$password string The plaintext password to hash.
Résultat string Returns a secure hash of {@link $password}.

hashPasswordPhpass() public méthode

Create a password hash using Phpass's algorithm.
public hashPasswordPhpass ( string $password ) : string
$password string The plaintext password to hash.
Résultat string Returns a password hash.

Property Details

$Weak public_oe property

public bool $Weak
Résultat boolean

$algorithms protected_oe property

protected array $algorithms
Résultat array

$portable_hashes public_oe property

public bool $portable_hashes
Résultat boolean