def METHOD_NAME(
    n: int, character_set: str = string.ascii_letters + string.digits
) -> str:
    """
    Generate a random string
    This function generates a random string. The length is specified by the user. The character set
    can optionally be specified by the user.
    This function is safe to use for cryptographic purposes.
    WARNING: This function may block if the system does not have sufficient entropy.
    :param n: The desired number of characters in the random string
    :param character set: The set of characters that may be included in the random string, defaults
                          to alphanumerics
    """
    return _generate_random_string(secrets.SystemRandom().choices, n, character_set)