Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- # -*- coding: utf-8 -*-
- """
- Generador Simple de clave
- Clave generada con 12
- carácteres alfanuméricos
- --> Cambiar range(12) para mayor
- o menor extensión de la clave
- Salida con range(12) --> `As1xeZ8Nk6M0`
- Salida con range(10) --> `V24woaEX4U`
- """
- import string
- import secrets
- alfabeto = string.ascii_letters + string.digits
- while True:
- password = ''.join(secrets.choice(alfabeto) for i in range(12))
- if (any(c.islower() for c in password)
- and any(c.isupper() for c in password)
- and sum(c.isdigit() for c in password) >= 3):
- break
- print(password)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement