hex-in / libscrc

libscrc is a library for calculating CRC3 CRC4 CRC5 CRC6 CRC7 CRC8 CRC10 CRC11 CRC12 CRC15 CRC16 CRC24 CRC30 CRC31 CRC32 CRC64 CRC82
GNU General Public License v3.0
49 stars 13 forks source link

Docstring for libscrc.crc32 mentions wrong polynomial #17

Closed achim1 closed 10 months ago

achim1 commented 11 months ago

The docstring for libscrc.crc32 says the following:

❯ libscrc.crc32?
Docstring: Calculate CRC (WinRAR, File) of CRC32  [Poly=0xEDB88320, Init=0xFFFFFFFF, Xorout=0xFFFFFFFF Refin=True Refout=True]
Type:      builtin_function_or_method

However, looking into the implementation of _crc32_crc32 it says the used polynomial is CRC32_POLYNOMIAL_04C11DB7 which is defined as 0x04C11DB7L. This is for version 1.8.1.

hex-in commented 10 months ago

The docstring is incorrect. Thank you for your reminder.