Skip to content

random

random_string(length=10)

Generates a random string of letters and digits of the specified length.

Source code in backend/shared/random.py
5
6
7
8
9
def random_string(length=10) -> str:
    """
    Generates a random string of letters and digits of the specified length.
    """
    return ''.join(random.choice(string.ascii_letters + string.digits) for _ in range(length))