-
Notifications
You must be signed in to change notification settings - Fork 0
/
generator_class.py
executable file
·99 lines (80 loc) · 3.31 KB
/
generator_class.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
from string import ascii_letters, punctuation, digits, ascii_lowercase, ascii_uppercase
from random import choice
class Generate_Password:
def __init__(self, tam, arg):
self.tam = tam
self.arg = arg
self.l = 0
def full(self):
self.l = list()
self.liste = []
if self.arg == 1:
for i in range(0, self.tam):
self.l = choice(ascii_uppercase + ascii_lowercase + digits)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 2:
for i in range(0, self.tam):
self.l = choice(ascii_uppercase + ascii_lowercase + punctuation)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 3:
for i in range(0, self.tam):
self.l = choice(ascii_uppercase + ascii_lowercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 4:
for i in range(0, self.tam):
self.l = choice(ascii_uppercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 5:
for i in range(0, self.tam):
self.l = choice(digits + punctuation + ascii_uppercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 6:
for i in range(0, self.tam):
self.l = choice(digits + punctuation + ascii_lowercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 7:
for i in range(0, self.tam):
self.l = choice(digits + punctuation)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 8:
for i in range(0, self.tam):
self.l = choice(digits + ascii_uppercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 9:
for i in range(0, self.tam):
self.l = choice(digits + ascii_lowercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 10:
for i in range(0, self.tam):
self.l = choice(digits)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 11:
for i in range(0, self.tam):
self.l = choice(punctuation + ascii_uppercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 12:
for i in range(0, self.tam):
self.l = choice(punctuation + ascii_lowercase)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 13:
for i in range(0, self.tam):
self.l = choice(punctuation)
self.liste.append(self.l)
return ''.join(self.liste)
elif self.arg == 14:
for i in range(0, self.tam):
self.l = choice(ascii_uppercase + ascii_lowercase + punctuation + digits)
self.liste.append(self.l)
return ''.join(self.liste)