mirror of
https://github.com/rjNemo/pass-gen
synced 2026-06-06 02:26:42 +00:00
17 lines
452 B
Python
17 lines
452 B
Python
import string
|
|
import random
|
|
|
|
|
|
def generate_password(seed: int, length: int = 8, symbols: bool = False) -> str:
|
|
lowercase = string.ascii_lowercase
|
|
uppercase = string.ascii_uppercase
|
|
digits = string.digits
|
|
punctuation = string.punctuation
|
|
|
|
letters = lowercase + uppercase + digits
|
|
if symbols:
|
|
letters += punctuation
|
|
|
|
random_generator = random.Random(seed)
|
|
|
|
return "".join(random_generator.sample(letters, length))
|