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)