コード例 #1
0
        public TelemetryWrapper(short messageType, byte[] message)
        {
            if (message.Length > short.MaxValue)
            {
                throw new ArgumentException(string.Format(message.Length.ToString()),
                                            nameof(message));
            }

            uint crc = Crc32.CalculateHash(message);

            this.Header  = new TelemetryHeader(messageType, (short)message.Length, crc);
            this.Message = message;
        }
コード例 #2
0
 private bool CheckCrc(uint expectedCrc, byte[] bytes) => Crc32.CalculateHash(bytes) == expectedCrc;