• Compresses src into dst and returns a subarray into dst containing the compressed data.

    If no dst is given or if it's smaller than compress bound, it's automatically allocated with the length given by compressBound(src.length).

    Usually, the length of original (decompressed data) is stored somewhere with compressed data (for example, as 4 little-endian bytes in the beginning), so that an appropriate space can be allocated for decompress(), but this function doesn't do it — it so it's up to the caller to write it.

    Throws an error if input is too large (see maxCompressedLength()).

    This is a bare block compression without any framing.

    Parameters

    • src: Uint8Array
    • Optionaldst: Uint8Array

    Returns Uint8Array