Skip to content

Instantly share code, notes, and snippets.

@locnnil
Last active February 9, 2022 12:17
Show Gist options
  • Save locnnil/4e4e8f6737b5152fc7b409a6f472a085 to your computer and use it in GitHub Desktop.
Save locnnil/4e4e8f6737b5152fc7b409a6f472a085 to your computer and use it in GitHub Desktop.
Necessary CRC type

Calculate the necessary CRC type

Beeing B the number of bytes of your message the necessary numbers necessary in your CRC gonna be:

N >= ln(8*B+1)/ln(2) -1

This formula cames from the manipulation of the formula B = (2**(N+1) -1)/8

OBS: rembering that only exists CRC8, CRC16 and CRC32 (until now)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment