def check_password(self, passwd_to_check):
    if isinstance(passwd_to_check, str):
        passwd_to_check = bytes(passwd_to_check, 'utf-8')
passwd = bytes(self.passwd, 'utf8')
return bcrypt.hashpw(passwd_to_check, passwd) == passwd
BCrypt. How to store salt with python3?