Answer the question
In order to leave comments, you need to log in
Why does hash_password() generate a different value each time?
The question is rather not why (because it is clear that it is because of the salt, which is different every time), but what is the point of this?
If I write such a generated password to the database, and then I compare the user's entered value encrypted by this function with the value in the database, then they will be different, respectively, the user will never be able to enter the site.
Another thing is the use of any other function, be it sha256, sha512, or the same md5. They constantly generate the same value, so it can always be compared with the value in the base.
So how to be?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question