I am attempting to hash a password before I store it in a user database, so I run the code:
$hashedPass = password_hash($pass, PASSWORD_DEFAULT);
This code gives me a value, say $2y$10$wAJr0Z1spRtOcK4cLhIkguUCKgwZKYrwm.nRhm6AtCfDH8ri7ylJu which are stored in the database. Now when I attempt to log in, the same string put in as a password gives a completely different $hashedPass: say $2y$10$cayCQDSQ6pCICSozuIgBNu9uIopIoT5R6Y7aHXG6wx4v/oKx.Ipse
Is this just random? Is there something I should use instead?