Link has invented an algorithm called CRC-LINK. In order to calculate CRC-LINK checksum of a datagram, let's assume the input byte array as

and the CRC-LINK polynomial as

(

), and follow the three steps below.
-
Treat each byte of the input byte array
as an 8-bit binary number. Append 32 zero bits to the end of
, creating an initial remainder
.
-
Repeat the following step for
times, where
is the number of bits in
.
-
If the most significant bit of
is 1, shift
one bit to the left, then perform an XOR operation: XOR the most significant 32 bits of
with the CRC-LINK polynomial
.
-
Otherwise, just shift
one bit to the left.
-
The most significant 32 bits of
is the CRC-LINK checksum of
.
For example, if $D$ = {0x01, 0x02}, the CRC-LINK checksum can be calculated by:
00000001 00000010 00000000 00000000 00000000 00000000
(shift left for 7 bits)
10000001 00000000 00000000 00000000 00000000 00000000
(shift left for 1 bit, then xor P)
00000110 11000001 00011101 10110111 00000000 00000000
(shift left for 5 bits)
11011000 00100011 10110110 11100000 00000000 00000000
(shift left for 1 bit, then xor P)
10110100 10000110 01110000 01110111 00000000 00000000
(shift left for 1 bit, then xor P)
01101101 11001101 11111101 01011001 00000000 00000000
(shift left for 1 bit)
11011011 10011011 11111010 10110010 00000000 00000000
(since we have shifted 16 bits in total, the left 32 bits above is what we need)
Please note that CRC-LINK may be slightly different from CRC32.
For a datagram consisting of three parts: a header (

bytes), a checksum (

bytes), and a footer (

bytes), the header and footer are given, while the checksum needs to be determined by you. You should choose a checksum that matches the CRC-LINK calculation result of the entire datagram. Formally, you should make sure CRC-LINK(concat(header,YourAnswer,footer)) equals to YourAnswer.
You may refer the example explanation for better understanding of how to check your answer.