Oh ok, I guess this doesn't happen with bcrypt, right? Because it spits out a different hash every time you hash it.
How else would you verify that the password matches ?
The output of your library's BcryptEncoder.encode(password) includes not only the password hash but information about the algorithm and the salt. That's what you store in your database. That extra information tells the decode function how to decode later on.
See here:
http://stackoverflow.com/questions/6832445/how-can-bcrypt-ha...