class Passwords

Password Hashing.

Traits

Strict class for better experience.

Methods

__construct(int $algo = PASSWORD_DEFAULT, array $options = [])

See http://php.net/manual/en/password.constants.php

string
hash(string $password)

Computes salted password hash.

bool
verify(string $password, string $hash)

Verifies that a password matches a hash.

bool
needsRehash(string $hash)

Checks if the given hash matches the options.

Details

at line 32
__construct(int $algo = PASSWORD_DEFAULT, array $options = [])

See http://php.net/manual/en/password.constants.php

Parameters

int $algo
array $options

at line 42
string hash(string $password)

Computes salted password hash.

Parameters

string $password

Return Value

string

at line 58
bool verify(string $password, string $hash)

Verifies that a password matches a hash.

Parameters

string $password
string $hash

Return Value

bool

at line 67
bool needsRehash(string $hash)

Checks if the given hash matches the options.

Parameters

string $hash

Return Value

bool