Hello, I need to be able to store values using hash values on grids, and also be able to update them.
Like the md5 option you already have.
Thank you!
1 Answers
Hi,
If use md5 in on_update or on_insert callbacks, like:
$data["params"]["password"] = md5($data["params"]["password"]);
To replace md5, you can use following:
$data["params"]["password"] = password_hash($data["params"]["password"],PASSWORD_DEFAULT);
This will save the hash in the database.
In order to verify the hash, you need to call passport_verify function:
$pass_hash contains the hash from database and $password contains the user posted password:
if (password_verify($password, $pass_hash))
{ echo "valid"; }
More details here: https://www.phpmentoring.org/blog/php-password-verify-function
Your Answer