'Validates that self.hash(password) == stored_hash.
Args:
password (str): Password to hash.
stored_hash (str): Expected hash value.
Returns:
Whether self.hash(password) == stored_hash (bool).'

def validate_hash(self, password, stored_hash):

    if stored_hash:
        return (bcrypt.hashpw((password.encode('utf8') + self.hs.config.password_pepper), stored_hash.encode('utf8')) == stored_hash)
    else:
        return False
