def __init__(self, username, password, email, website): """ Instantiate a new user """ self.username = username self.salt = security.rand_string() self.password = security.hash_string(password, self.salt) self.email = email self.website = website
def login(self, password): return security.hash_string(password, self.salt) == self.password