import zlib
import struct


def CheckFCS(frame):
    """Return true when the FCS at the end of the frame is correct, i.e. the frame is not corrupted
    """

    crc32 = zlib.crc32(frame[:-4])
    fcs = struct.unpack('l', frame[-4:])[0]
    return fcs == crc32