This piece of code rejects the bad hash. I copied this code from get_salt.