import zlib


def compress(data: bytes) -> bytes:
    """Compress a byte array using zlib

    Args:
        data (bytes): Binary data to be compressed

    Returns:
        bytes: A byte array of compressed data.
    """
    return zlib.compress(data)