lundi 5 octobre 2020

Pass Generator fucntion [closed]

So i found this line of code at the beggining of pass generator script. Can anyone please help me understand what it does

class PasswordGenerator():

@staticmethod
def gen_sequence(conditions): #must have  conditions (in a list format), for each member of the list possible_characters
    possible_characters=[str.ascii_lowercase, str.ascii_uppercase, str.digits, str.punctuation]
    sequence=""
    for x in range(len(conditions)):
        if conditions[x]:
            sequence+=possible_characters[x]
        else:
            pass
    return sequence



Aucun commentaire:

Enregistrer un commentaire