madler / zlib

A massively spiffy yet delicately unobtrusive compression library.
http://zlib.net/
Other
5.46k stars 2.41k forks source link

CRC32C support #981

Closed mullermp closed 1 month ago

mullermp commented 1 month ago

Hello. Is there planned support for CRC32C?

madler commented 1 month ago

In zlib? No. the zlib, gzip, and zip formats all use CRC-32/ISO-HDLC. There is no application for CRC-32/ISCSI in zlib.

You can look to crcany for the generation of C code to compute any CRC. Also this answer on stackoverflow has my fast code to use the Intel hardware instruction for CRC-32C.

mullermp commented 1 month ago

Thanks for your prompt response. I am trying to find the best place to put a CRC32C implementation in the Ruby ecosystem. There is a gem called zlib that interfaces with this library that has CRC32 checksum code and it felt natural to put CRC32C there. I'm not sure how much you've used Ruby, but do you have any opinions on where that would live?

madler commented 1 month ago

I don't know where it would best live in the standard gems. A quick google search turned up this: https://github.com/postmodern/digest-crc

mullermp commented 1 month ago

Yep, I've seen that one. I try to avoid dependencies for our library (AWS SDK for Ruby), which is why my motivation was for it to exist in a bundled/standard gem such as zlib.