phpBB API Documentation
Class

phpbb\passwords\driver\phpass

class phpass extends salted_md5

Constants

PREFIX

Methods

__construct(config $config, helper $helper)

Constructor of passwords driver object

from base
bool is_supported()

Check if hash type is supported

from base
bool is_legacy()

Check if hash type is a legacy hash type

from salted_md5
string get_settings_only(string $hash, bool $full = false)

Get only the settings of the specified hash

from salted_md5
string get_prefix()

Returns the hash prefix

bool|string hash(string $password, $setting = '')

Hash the password

from salted_md5
bool check(string $password, string $hash, array $user_row = array())

Check the password against the supplied hash

from salted_md5
bool|array get_hash_settings(string $hash)

Get hash settings

from salted_md5

Details

in base at line 33
public __construct(config $config, helper $helper)

Constructor of passwords driver object

Parameters

config $config phpBB config
helper $helper Password driver helper

in base at line 42
public bool is_supported()

Check if hash type is supported

Return Value

bool True if supported, false if not

in salted_md5 at line 59
public bool is_legacy()

Check if hash type is a legacy hash type

Return Value

bool True if it's a legacy hash type, false if not

in salted_md5 at line 165
public string get_settings_only(string $hash, bool $full = false)

Get only the settings of the specified hash

Parameters

string $hash Password hash
bool $full Return full settings or only settings related to the salt

Return Value

string String containing the hash settings

at line 23
public string get_prefix()

Returns the hash prefix

Return Value

string Hash prefix

in salted_md5 at line 67
public bool|string hash(string $password, $setting = '')

Hash the password

Parameters

string $password The password that should be hashed
$setting

Return Value

bool|string Password hash or false if something went wrong during hashing

in salted_md5 at line 103
public bool check(string $password, string $hash, array $user_row = array())

Check the password against the supplied hash

Parameters

string $password The password to check
string $hash The password hash to check against
array $user_row User's row in users table

Return Value

bool True if password is correct, else false

in salted_md5 at line 140
public bool|array get_hash_settings(string $hash)

Get hash settings

Parameters

string $hash The hash that contains the settings

Return Value

bool|array Array containing the count_log2, salt, and full hash settings string or false if supplied hash is empty or contains incorrect settings