VectorNav C++ Library
error_detection.h
1 #ifndef _VNDATA_ERROR_DETECTION_H_
2 #define _VNDATA_ERROR_DETECTION_H_
3 
4 #include <cstddef>
5 #include <string>
6 
7 #include "int.h"
8 
9 namespace vn {
10 namespace data {
11 namespace integrity {
12 
14 class Checksum8
15 {
16 
17  // Public Methods /////////////////////////////////////////////////////////
18 
19 public:
20 
27  static uint8_t compute(const char data[], size_t length);
28 
29 };
30 
32 class Crc16
33 {
34 
35  // Public Methods /////////////////////////////////////////////////////////
36 
37 public:
38 
45  static uint16_t compute(const char data[], size_t length);
46 
47 };
48 
49 }
50 }
51 }
52 
53 #endif
Helpful class for working with 8-bit checksums.
Definition: error_detection.h:14
static uint8_t compute(const char data[], size_t length)
Computes the 8-bit checksum of the provided data.
Helpful class for working with 16-bit CRCs.
Definition: error_detection.h:32
static uint16_t compute(const char data[], size_t length)
Computes the 16-bit CRC of the provided data.
Definition: attitude.h:8