from typing import Union
import base64


def encode_to_base64(md5: str, id_: Union[str, int]) -> str:
    """Sometime the API returns the id as number only. Need to join the id with md5 in base64.

    Args:
        md5: The MD5 of the file sent to scan
        id_: The id returned from the file scan

    Returns:
        base64 encoded of md5:id_
    """
    return base64.b64encode(f'{md5}:{id_}'.encode('utf-8')).decode('utf-8')