示例#1
0
文件: ircdb.py 项目: Elwell/supybot
 def setPassword(self, password, hashed=False):
     """Sets the user's password."""
     if hashed or self.hashed:
         self.hashed = True
         self.password = utils.saltHash(password)
     else:
         self.password = password
示例#2
0
 def setPassword(self, password, hashed=False):
     """Sets the user's password."""
     if hashed or self.hashed:
         self.hashed = True
         self.password = utils.saltHash(password)
     else:
         self.password = password
示例#3
0
文件: ircdb.py 项目: Elwell/supybot
 def checkPassword(self, password):
     """Checks the user's password."""
     if password is None:
         return False
     if self.hashed:
         (salt, _) = self.password.split('|')
         return (self.password == utils.saltHash(password, salt=salt))
     else:
         return (self.password == password)
示例#4
0
 def checkPassword(self, password):
     """Checks the user's password."""
     if password is None:
         return False
     if self.hashed:
         (salt, _) = self.password.split('|')
         return (self.password == utils.saltHash(password, salt=salt))
     else:
         return (self.password == password)
示例#5
0
 def testSaltHash(self):
     s = utils.saltHash('jemfinch')
     (salt, hash) = s.split('|')
     self.assertEqual(utils.saltHash('jemfinch', salt=salt), s)
示例#6
0
 def testSaltHash(self):
     s = utils.saltHash('jemfinch')
     (salt, hash) = s.split('|')
     self.assertEqual(utils.saltHash('jemfinch', salt=salt), s)