예제 #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)
예제 #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)
예제 #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)
예제 #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)