Пример #1
0
 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
Пример #2
0
 def login(self, password):
     return security.hash_string(password, self.salt) == self.password