Using Adler32 over a four byte payload is a bad idea [1]
This has bitten me personally when designing an embedded protocol that sends 128 byte frames (of which not all are checksummed as those include hop count and checksum) that used Adler32 as checksum. It would not reliably detect a broken packet, so I had to switch to crc32 (for which the STM32 even provides hardware acceleration).
This also told me the lesson of including some option bits for later use to make the upgrade process less painful…
This has bitten me personally when designing an embedded protocol that sends 128 byte frames (of which not all are checksummed as those include hop count and checksum) that used Adler32 as checksum. It would not reliably detect a broken packet, so I had to switch to crc32 (for which the STM32 even provides hardware acceleration).
This also told me the lesson of including some option bits for later use to make the upgrade process less painful…
[1] https://en.wikipedia.org/wiki/Adler-32#Weakness