Created
February 1, 2024 18:13
-
-
Save PlaceReporter99/8da52f37c9ad0424ea253ead20948d99 to your computer and use it in GitHub Desktop.
A secure password generator using characters from different languages.
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
import secrets | |
CHARS = [*range(0x1200,0x1380)] + [*range(0x780,0x7b2)] + [*range(0x1780,0x17fa)] + [*range(0x900,0x980)] + [*range(0xabc0,0xabfa)] + [*range(0x20,0x7e)] + [*range(0x0c80, 0x0cf4)] | |
def get_pass(length, num): | |
return [''.join(secrets.choice([*map(chr, CHARS)]) for _ in range(length)) for _ in range(num)] | |
def main(): | |
print() | |
length = int(input("Length of password?\n")) | |
print() | |
num = int(input("How many passwords?\n")) | |
print() | |
print('\n'.join(get_pass(length, num))) | |
print() | |
print("Passwords generated!") | |
if input("Press enter to do it again, type in anything else and then press enter to quit.") == "": | |
main() | |
else: | |
quit() | |
if __name__ == "__main__": | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment