Skip to main content
← PSoXide SDK guides and examples · SDK f2fec1c301f1 · All Cargo features enabled; check feature gates before use.

compress

Function compress 

Source
pub fn compress(src: &[u8], dst: &mut [u8]) -> Option<usize>
Expand description

Compress src into dst. Returns the compressed length, or None if dst is too small to hold the result.

The match search is a bounded linear scan of the window – simple and allocation-free. Save writes are deliberate, infrequent actions, so the O(n·window) cost is acceptable; swap in a hash-chain finder if a project compresses large buffers on a hot path.