php - De hash a password_hash with a cost -


if hash example password 20 times cost:

$pass1=password_hash($pass, password_default, ['cost' => 20]) 

and store in database, how can let user login on website, if password_verify() know , de hash password "once time"?

did need password_verify ($password,$storedpassword) 20 times? or there easier way it? saw password_needs_rehash, have tried use , didn't work.

i found solution, after bit of time

$pass1=password_hash($pass, password_default, ['cost' => 20]); password_verify($passwordinputbyuser, $pass1); 

so simple!


Comments

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -