8 lines
222 B
Python
8 lines
222 B
Python
import random
|
|
import string
|
|
|
|
def random_string(length: int = 4) -> str:
|
|
allowed_chars: str = string.ascii_letters + string.digits
|
|
|
|
return ''.join(random.SystemRandom().choice(allowed_chars) for _ in range(length))
|