from typing import Callable


def id_generator(y: int, choice: Callable) -> str:
    """
    Generate captcha Is. Accepts either secrets or random, depending on if the use case needs to be cryptographically
    secure.

    :param y: string length
    :type y: int
    :param choice: module to use
    :type choice: Callable
    :return: string in form of an ID
    """
    string = 'abcdefghijkmnopqrstuvwxyzABCDEFGHJKMNOPQRSTUVWXYZ'
    return ''.join(choice(string) for _ in range(y))