コード例 #1
0
ファイル: config.py プロジェクト: passwordly/pw
 def findHash(self, password):
   'Find a hash given the password'
   # Look for an existing hash
   for hash in self.getHashes():
     if hash[:4] == '$2a$' and checkHash(password, hash):
       return hash
   return None
コード例 #2
0
ファイル: user.py プロジェクト: passwordly/password.ly
 def getPassword(self, password):
     passwords = self.db.lrange("passwords-%s" % self.username, 0, -1)
     for index in range(len(passwords)):
         if checkHash(password=password, hash=passwords[index]):
             return UserPassword(self.db, self.username, passwords[index])
     return None
コード例 #3
0
ファイル: user.py プロジェクト: passwordly/password.ly
 def getPassword(self, password):
     passwords = self.db.lrange('passwords-%s' % self.username, 0, -1)
     for index in range(len(passwords)):
         if checkHash(password=password, hash=passwords[index]):
             return UserPassword(self.db, self.username, passwords[index])
     return None