Is there an existing Eiffel Studio library wrapper for zlib's crc32 function?

9 views
Skip to first unread message

Finnian Reilly

unread,
Jun 29, 2026, 5:04:13 AM (6 days ago) Jun 29
to Eiffel Users

I'm working on a project that needs CRC-32 checksums (specifically the standard CRC-32/ISO-HDLC variant, the same one used by gzip, PNG, and Ethernet) and was surprised not to find an existing Eiffel class for this anywhere in the base libraries. Or maybe I was using the wrong keyword.

finnian>:~/Dev/Eiffel/library/ISE-25.12/library$ !1903
rg -F -g '*.e' crc
wel/support/wel_windows_error_messages.e
70: Error_crc_value: INTEGER = 23
finnian>:~/Dev/Eiffel/library/ISE-25.12/library$ rg -F -g '*.e' CRC
finnian>:~/Dev/Eiffel/library/ISE-25.12/library$ rg -F -g '*.e' cyclic
base/elks/structures/list/circular.e
109: -- Move cursor to next item, cyclically.
123: -- Move cursor to previous item, cyclically.
136: -- cyclically.
160: -- Move cursor to `i'-th position from current start, cyclically.
...
vision2/interface/kernel/ev_color.e
208: -- Hue values are cyclical (like values of sin or cos functions).

zlib is distributed with EiffelStudio across all platforms, not just Windows. Given that, and given how trivial the wrapper is to write (a single external "C inline" call to crc32() from zlib.h, no more than a dozen lines), it seems like an obvious candidate for inclusion as a standard library function rather than something every project has to roll on its own.

I'd suggest it belongs in either testing or base_extension. It's a small, self-contained utility with no dependencies beyond zlib itself. The function has obvious applications for testing and the Eiffel-Loop testing framework uses CRC-32 where all you want to test for is if some output changed from before. (This uses a native Eiffel implementation which maybe slower than zlib)

For now I have incorporated the zlib version into Eiffel-Loop's C_STRING_8.

Happy to share what I have if it's useful to others.

Thanks,
Finnian


Finnian Reilly

unread,
Jun 29, 2026, 5:11:26 AM (6 days ago) Jun 29
to eiffel...@googlegroups.com

There is a quasi-canonical catalog for various kinds of CRC — the CRC RevEng Catalogue (maintained by Greg Cook) — which lists dozens of named CRC variants including CRC-32/ISO-HDLC, CRC-32/BZIP2, CRC-32C (Castagnoli, used in iSCSI/SCTP), CRC-32/MPEG-2, etc. So "CRC-32" without qualification is ambiguous in principle, but in practice the zlib/Ethernet/PNG variant (CRC-32/ISO-HDLC) is so dominant that it's the de facto default almost everyone means.

--
You received this message because you are subscribed to the Google Groups "Eiffel Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to eiffel-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/eiffel-users/007ee85d-93b0-4eea-8f89-b9d2bb0e7db0n%40googlegroups.com.


-- 
SmartDevelopersUseUnderScoresInTheirIdentifiersBecause_it_is_much_easier_to_read
Reply all
Reply to author
Forward
0 new messages