I was reading about the new password hashing api in php 5.5, it's has hashing function password_hash()
which makes providing salt optional, which means it would make salt automatically, but since the salt needs to be same for one password for it to be able to hash again for comparison, it must generate salt from the hash, or from the password itself. How does that work?
Edit: I have seen the linked question which is supposedly duplicate, but it doesn't answer the question. If the salt is generated randomly, how do we know it will be same for comparison. For comparison we need to know the salt. But it is generated randomly every time.