Simplify several functions

This commit is contained in:
VirtuBox
2019-10-01 04:08:54 +02:00
parent 555760164b
commit 715497d3b1
6 changed files with 27 additions and 33 deletions

View File

@@ -3,15 +3,10 @@ import string
class RANDOM:
"""Random strings generator"""
def short(self):
def gen(self, length='24'):
short_random = ''.join([random.choice
(string.ascii_letters + string.digits)
for n in range(8)])
for n in range(length)])
return short_random
def long(self):
long_random = ''.join([random.choice
(string.ascii_letters + string.digits)
for n in range(24)])
return long_random