why bcrypt generates different hashes?
Bcrypt generates a random 128-bit salt during hashing. This salt becomes part of the hash, hence we always get a different hash value for the same input string. The random salt is actually used to deter brute-force attacks. ... So even if the hash values are different, the password matching won't fail.