Exemplo n.º 1
0
 def check_password(self, raw_password):
     """
     Returns a boolean of whether the raw_password was correct.
     """
     salt, hsh = self.pw_hash.split(u'$')
     return hsh == get_hexdigest(salt, raw_password)
Exemplo n.º 2
0
 def check_password(self, raw_password):
     """
     Returns a boolean of whether the raw_password was correct.
     """
     salt, hsh = self.pw_hash.split(u'$')
     return hsh == get_hexdigest(salt, raw_password)
Exemplo n.º 3
0
 def set_password(self, raw_password):
     """Set a new sha1 generated password hash"""
     salt = u'%05x' % random.getrandbits(20)
     hsh = get_hexdigest(salt, raw_password)
     self.pw_hash = u'%s$%s' % (salt, hsh)
Exemplo n.º 4
0
 def set_password(self, raw_password):
     """Set a new sha1 generated password hash"""
     salt = u'%05x' % random.getrandbits(20)
     hsh = get_hexdigest(salt, raw_password)
     self.pw_hash = u'%s$%s' % (salt, hsh)