def check_password(self, password): return MyHash.verify(password, self.password)
def set_password(self, newpassword): try: self.password = MyHash.encrypt(newpassword) return 0 except: return 1
def __init__(self, username, password, email): self.username = username self.password = MyHash.encrypt(password) self.email = email self.ctime = datetime.datetime.today() self.id = str(uuid.uuid3(uuid.NAMESPACE_DNS, str(uuid.uuid1())))