Beispiel #1
0
        /// <summary>
        /// Calculates the checksum of the provided Q subchannel buffer and emplaces it
        /// </summary>
        /// <param name="buffer">12 byte Q subchannel buffer: input and output buffer for operation</param>
        /// <param name="offset">location within buffer of Q subchannel</param>
        public static ushort SubQ_SynthChecksum(byte[] buf12, int offset)
        {
            ushort crc16 = CRC16_CCITT.Calculate(buf12, offset, 10);

            //CRC is stored inverted and big endian
            buf12[offset + 10] = (byte)(~(crc16 >> 8));
            buf12[offset + 11] = (byte)(~(crc16));

            return(crc16);
        }
Beispiel #2
0
 /// <summary>
 /// Caclulates the checksum of the provided Q subchannel buffer
 /// </summary>
 public static ushort SubQ_CalcChecksum(byte[] buf12, int offset)
 {
     return(CRC16_CCITT.Calculate(buf12, offset, 10));
 }