justinwongcn/moonpgp/compress does not have a README file

    CompressedAlgo

    pub(all) enum CompressedAlgo {
    Uncompressed
    Zip
    Zlib
    BZip2
    } derive(Eq,
    Debug
    )

    Compression algorithms for the Compressed Data packet (RFC 9580 §9.4).

    CompressedAlgo::equal

    CompressedAlgo::not_equal

    fn CompressedAlgo::not_equal(x : CompressedAlgo, y : CompressedAlgo) -> Bool

    CompressedAlgo::number

    fn CompressedAlgo::number(self : CompressedAlgo) -> Int

    bzip2_decompress

    fn bzip2_decompress(data : BytesView) -> Bytes raise

    Decompress a full bzip2 stream without an explicit cap. Callers inside the packet walk always use the capped form; this variant exists for parity with zip_decompress / zlib_decompress.

    bzip2_decompress_capped

    fn bzip2_decompress_capped(data : BytesView, max_out : Int) -> Bytes raise

    Decompress a full bzip2 stream under a hard output cap. All bounds follow the reference decoder: at most level * 100000 octets per block, the MTF/RLE2 stream within the block, and the total decompressed size within max_out (the M4 policy, as for zlib).

    compressed_algo_of_number

    fn compressed_algo_of_number(n : Int) -> CompressedAlgo?

    zip_compress

    fn zip_compress(data : BytesView) -> Bytes

    Raw DEFLATE (RFC 1951) — the ZIP algorithm of the Compressed packet.

    zip_decompress

    fn zip_decompress(data : BytesView) -> Bytes raise

    Raw DEFLATE decompression. The decompression end must be complete: incoming mail may arrive compressed with dynamic Huffman tables.

    zip_decompress_capped

    fn zip_decompress_capped(data : BytesView, max_out : Int) -> Bytes raise

    Raw DEFLATE decompression with a hard output cap (M4): flate's limited inflater stops (raising) once the cap is exceeded, so the bomb never materializes.

    zlib_compress

    fn zlib_compress(data : BytesView) -> Bytes

    ZLIB (RFC 1950) wrapper — algorithm 2 of the Compressed packet.

    zlib_decompress

    fn zlib_decompress(data : BytesView) -> Bytes raise

    zlib_decompress_capped

    fn zlib_decompress_capped(data : BytesView, max_out : Int) -> Bytes raise

    ZLIB decompression with a hard output cap (M4): the streaming decoder runs with bounded output windows, so total allocation stays at the cap instead of materializing the payload first. Checksum and framing stay with the decoder.