compress/gzip: unable to reproduce the same gzip/DEFLATE compressed output as Python/Rust #40830
Labels
FrozenDueToAge
WaitingForInfo
Issue is not actionable because of missing required information, which needs to be provided.
For the attached file eicar.bin.gz, 69 bytes of data
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*\n
, including the trailing newlineSample code in Go(lang):
produces a different output in the DEFLATE part, ignoring the gzip header, and CRC32 checksum and uncompressed size in footer:
8a30f5570c5075700c88368909888a3035d10888d3347776d634af5571f574760cd20d0e71f473710c72d175f40bf10cf30c0a0dd60d710d0ed175f3f4715554f1d0f6d0e202040000ffff
Under compression level=6, both Python and Rust (as well as the standard unix
gzip
cli) manage to all agree on the output:8b30f5570c5075700c88368909888a3035d10888d3347776d634af5571f574760cd20d0e71f473710c72d175f40bf10cf30c0a0dd60d710d0ed175f3f4715554f1d0f6d0e20200
(DEFLATE part only, excluding gzip header and footer)The difference, for the unobservant reader is in the starting byte
8a
vs8b
, and the trailing bytes...e20200
vs...e202040000ffff
Is there a way to re-write the Golang code, so that the output is identical?
The text was updated successfully, but these errors were encountered: