function [crcTable] = generateCRCTable()

%generuje CRC tabulku
% do gen polynomu je nastavena hodnota 0x04C11DB7 (ale opacne poradi bitu)
gp = uint32(hex2dec('edb88320'));

crcTable = uint32(zeros(256,1));

for i = 0:255
    remainder = uint32(i);
    
    for j = 1:8
        if(bitand(remainder, 1) == 1)
            remainder = bitxor(bitshift(remainder,-1), gp);
            pok = dec2hex(remainder);
        else
            remainder = bitshift(remainder,-1);
            pok = dec2hex(remainder);
        end
    end
    
    crcTable(i+1) = remainder;
end

end