import string
import random


def generate_id(size: int = 6, chars: str = string.ascii_uppercase + string.digits) -> str:
    """Generate an ID with the given length and possible characters.
    Mostly used for an error ID.

    Args:
        size (int): The length of the generated ID. (Default: 6)
        chars (str): A ``str`` with all possible characters that the random generator can choose from. (Default: string.ascii_uppercase + string.digits)

    Returns:
        str: The ``str`` of the generated ID.
    """
    return ''.join(random.choice(chars) for _ in range(size))