Hi! I am trying to get the output of a crc32 to match the result from zlib and cannot figure out the correct inputs to do so. The answer to this SO has an example usage of zlib in Python that I’m trying to replicate in Go.
I have this currently:
table := crc32.MakeTable(0xb71dc104)
result := crc32.Update(0xFFFFFFFF, table, []byte(“123456789”))
result ^= 0xFFFFFFFF
The polynomial that zlib uses is 0x04C11DB7 but the go docs suggest that it expects reversed order. I might have done that wrong? I’ve tried little endian and big endian and all combinations of exclusive ors that I can think of. I’ve also tried crc64 and then casting back down. It’s gotta be something simple but I just haven’t been able to replicate it! Any ideas??
Hi @GonzaSaya! I figured it was something simple haha. I probably should’ve tried the one that says “most common polynomial” from the start. Thanks for the help!! Works like a charm.