I was under the impression, based on research, that when hashing a string with the same function, it will always return the same hash. I am running a program and using the password_hash() function in php to hash, but I continuously get a different hash as a result, therefore, when I compare them, it does not work.
Here is the example I am dealing with.
PIN to hash: 1212
Initial Hash is line 1, the other 3 are the following attempts:
$2y$10$5CAoU8snW79.8WpCS3T0Y.6OT4YkSYIlS2LrII8DweMzjTV5JGh2Cnone
$2y$10$SZgvvB7WG.gXB/AUbWeIOO8HnBit6F7fG.My/Pcyi4D0zXgb3/n3G
$2y$10$9b.WTA3r4ZYMHdtGN28.Je1qJ4R3n.1Mac1hD3kl.NleiCPmuZRianone
$2y$10$VEuLdnKUYftcJFtbY2KqJOJLQ4B/spuhRk6zywyTzjko7y4aZBGWunone
The function that I am using looks like this, and is used in 3 different places, but I didn't think that would affect the result.
$pin = password_hash($_POST['pin'],PASSWORD_DEFAULT);