import binascii
import zlib


def unpack_chunk(chunk_data: str) -> bytes:
    """
    Unpacks a previously packed chunk data back into the original
    bytes representation

    :param chunk_data:
        The compressed, base64 encoded string to convert back to the
        source bytes object.
    """

    if not chunk_data:
        return b''

    chunk_compressed = binascii.a2b_base64(chunk_data.encode('utf-8'))
    return zlib.decompress(chunk_compressed)