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; }
private bool CheckCrc(uint expectedCrc, byte[] bytes) => Crc32.CalculateHash(bytes) == expectedCrc;