Created
December 31, 2012 23:25
-
-
Save Aaron1011/4423796 to your computer and use it in GitHub Desktop.
Recursive password generator
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def get_letters(letter, choices): | |
return [letter] + choices.get(letter, []) | |
def recurpassgen(password, passwords=[""], CHOICES={'a': ['@', '4'], 's': ['$', '&']}): | |
if password == "": | |
return passwords | |
passwords = [p + letter for p in passwords for letter in get_letters(password[0], CHOICES)] | |
return recurpassgen(password[1:], passwords=passwords) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment