turns out it’s a pretty old piece of stdlib that used to be internal only, so wasn’t a deliberate omission per se, just CRC32c was happened to be used internally
NOTE: If you are starting a new project on Julia 0.6 or later, it is recommended to use the CodecZlib.jl package instead. CodecZlib.jl and other packages offer more unified interfaces for a wide range of file formats.
Yes, part of the reason for the standard library is to expose functionality that we needed for Julia internals, but whose API we don’t want to tie to Julia Base because the internals may change in the future.
Because of that, the CRC32c standard library is a good default choice for performance reasons.
Although it looks like zlib also uses optimized code by Adler, this still appears to be quite a bit slower than CRC32c. I guess it is calculating a CRC-32 variant that is not fully hardware accelerated?
(Which is confusing because CRC-32 does have hardware acceleration on ARM, which their implementation does appear to use very similarly to our code. Is this feature not enabled in the Zlib_jll build?)
but my hacked up version (i.e. your code) won’t to cover all the crc cases one may want (see the supported, buffer, and N bytes methods by crc32c, or even, corner cases that I can’t think of rn
so yeah, that’s not the way to go.
For now, I’m gonna use:
For no reason other than I already depend on this package.
I’m not sure why that follows. JLL packages are packages with semantic versioning, so you can reliably make your package depend on the documented zlib API.
It would be nice to register a simple CRC32 package which exposes same API as CRC32c but uses zlib’s crc32.
Out of curiosity, why do you need CRC-32 specifically and not CRC-32c? Are you handling some foreign data that comes with a CRC-32 checksum?
are people looking into every symbol exported by each version of the binary upstream and their corresponding call signature when versioning the jll? (again, probably doesn’t matter for Zlib and crc32 as they are probably fixed forever now)
fhs merged an update to fhs/CRC32.jl yesterday that (1) updates the README to link to functioning CRC32 packages and (2) updates fhs/CRC32.jl to work with Julia 1.x (e.g. for pedagogy, since it is far simpler than they other implementations).