You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The specifications for the compression formats are RFC 1950, RFC 1951, and RFC 1952. As specifications they do not specify what is considered "canonical" output, but only specify what is necessary for proper decompression. This implies that Go has the freedom to output whatever we want so long as it is decodable by a compliant decompressor.
The fact that other languages output the same bytes is likely because many implementations just wrap the C zlib library under the hood. On the other hand, the Go library actually implements compression with its own algorithms in pure Go.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes, it's right from https://golang.org/src/compress/zlib/example_test.go
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
Looked at https://golang.org/src/compress/zlib/example_test.go
And observed that byte 3 and up are different from most other languages.
What did you expect to see?
Bytes corresponding to the python3 example:
What did you see instead?
The Go code on line 22 of https://golang.org/src/compress/zlib/example_test.go
// Output: [120 156 202 72 205 201 201 215 81 40 207 47 202 73 225 2 4 0 0 255 255 33 231 4 147]
The text was updated successfully, but these errors were encountered: