An error-detection technique used widely in today’s computer networks is
based on CRC (Cyclic Redundancy Check).

CRC operates as follows:

Sender and receiver must first agree on a generator polynomial G (length
r + 1). Then the sender appends to each d-bit piece of data a checksum of
r bits, such that the complete pattern of d + r bits is exactly divisible
by G using modulo-2 arithmetic. In order to compute the checksum, the sender
appends r zero bits to the data and divides this d + r bits by the generator
polynomial G using modulo-2 division. The reminder (which is always r or
fewer bits) is appended to the data bits and transmitted to the receiver,
which divides the received bits by G. If the remainder is zero the receiver
knows that the data is correct.

Try CRC computation by yourself! First you have to select a generator polynomial
and give the binary form for the polynomial. Then you can to do the CRC
calculation by bitwise exclusive-or (XOR).