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