Function __global->ratchet_hash_verify
Definitions
sources/crypt.php
- Verify a password is correct by comparison of the hashed version.
- Visibility: public
- Is abstract?: No
- Is static?: No
- Is final?: No
- Returns: bool
Parameters
| Name | Type | Passed by reference? | Variadic? | Default | Set | Range | Description |
|---|---|---|---|---|---|---|---|
| $password | SHORT_TEXT | No | No | required parameter | N/A | N/A | The password in plain text |
| $salt | SHORT_TEXT | No | No | required parameter | N/A | N/A | The salt |
| $pass_hash_salted | SHORT_TEXT | No | No | required parameter | N/A | N/A | The prior salted&hashed password, which will also include the algorithm/ratcheting level (unless it's old style, in which case we use non-ratcheted md5) |
| $legacy_style | integer | No | No | 0 | N/A | N/A | CRYPT_LEGACY_* constant defining the legacy hashing style to fallback to |
Returns
- Whether the password is verified
- Type: boolean
- Set: N/A
- Range: N/A
Preview
Code (PHP)
/**
* Verify a password is correct by comparison of the hashed version.
*
* @param SHORT_TEXT $password The password in plain text
* @param SHORT_TEXT $salt The salt
* @param SHORT_TEXT $pass_hash_salted The prior salted&hashed password, which will also include the algorithm/ratcheting level (unless it's old style, in which case we use non-ratcheted md5)
* @param integer $legacy_style CRYPT_LEGACY_* constant defining the legacy hashing style to fallback to
* @return boolean Whether the password is verified
*/
function ratchet_hash_verify(string $password, string $salt, string $pass_hash_salted, int $legacy_style = 0) : bool
* Verify a password is correct by comparison of the hashed version.
*
* @param SHORT_TEXT $password The password in plain text
* @param SHORT_TEXT $salt The salt
* @param SHORT_TEXT $pass_hash_salted The prior salted&hashed password, which will also include the algorithm/ratcheting level (unless it's old style, in which case we use non-ratcheted md5)
* @param integer $legacy_style CRYPT_LEGACY_* constant defining the legacy hashing style to fallback to
* @return boolean Whether the password is verified
*/
function ratchet_hash_verify(string $password, string $salt, string $pass_hash_salted, int $legacy_style = 0) : bool

