import random
import string


def generate_admin_id(db) -> str:
    """Generates a unique admin id

    Args:
        db: db connection object

    Returns:
        str
    """
    admin_id = "".join(
        random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits)
        for _ in range(16)
    )
    admin_id = "adm_" + admin_id

    if db.find_one({"user_id": admin_id}):
        admin_id = generate_admin_id(db)
    return admin_id