Aggiunta possibilitá di Random tra due valori
parent
8a7269e591
commit
0a12dfc27c
Binary file not shown.
|
@ -2,7 +2,11 @@ import random
|
||||||
import string
|
import string
|
||||||
|
|
||||||
ALPHANUMERIC_CHARS = string.ascii_lowercase + string.ascii_uppercase + string.digits
|
ALPHANUMERIC_CHARS = string.ascii_lowercase + string.ascii_uppercase + string.digits
|
||||||
MAX_STRING_LENGTH = 11
|
MIN_STRING_LENGTH = 11
|
||||||
|
MAX_STRING_LENGTH = 27
|
||||||
|
|
||||||
def generate_random_string(chars=ALPHANUMERIC_CHARS,length=MAX_STRING_LENGTH):
|
random_string_length = random.randint(MIN_STRING_LENGTH,MAX_STRING_LENGTH)
|
||||||
|
|
||||||
|
|
||||||
|
def generate_random_string(chars=ALPHANUMERIC_CHARS,length=random_string_length):
|
||||||
return "".join(random.choice(chars) for _ in range(length))
|
return "".join(random.choice(chars) for _ in range(length))
|
Loading…
Reference in New Issue