So I have data compressed in php in this way:
$compressed = gzcompress($pairs, 9);
When I try to decompress obtained data with rust in this way:
let mut d = flate2::read::GzDecoder::new(compressed_pairs.as_bytes());
let mut s = String::new();
d.read_to_string(&mut s).unwrap();
println!("{}", s);
I get this error - thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Custom { kind: InvalidInput, error: "invalid gzip header" }',
As I read here gzcompress is similar to gzencode, but with different header. Is it possible to decode it in Rust?
I found out here a C library and I thought that I can connect it to my Rust code, but may be there are simpler solution?