def is_valid_pw(self, pw): if hashpw(pw, self.pwsalt) == self.pwhash: return True else: return False
def __init__(self, name, pw): self.name = name pwsalt = salt() self.pwhash = hashpw(password=pw, salt=pwsalt) self.pwsalt = pwsalt