decompress

Function decompress 

Source
pub fn decompress(data: &[u8], kind: &CompressionKind) -> Result<Vec<u8>>
Expand description

Decompresses data that was compressed with the specified algorithm

Enforces a maximum output size limit to prevent decompression bombs (DoS attacks). The limit is set to MAX_PAYLOAD_SIZE to align with protocol packet limits.

ยงErrors

Returns ProtocolError::DecompressionFailure if:

  • Decompression fails
  • Output size exceeds MAX_DECOMPRESSION_SIZE