Nix (Dev) 3.5.10
dev - 3.5.10 - 1af9301
Loading...
Searching...
No Matches
Crc16.hpp
Go to the documentation of this file.
1
2#ifndef IV_SRC_CRYPTO_CRC16_HPP_
3#define IV_SRC_CRYPTO_CRC16_HPP_
4#include <cstdint>
5
6//Extracted and modified from here https://www.modbustools.com/modbus_crc16.html
7namespace iv::crypto
8{
9class Crc16
10{
11public:
12 Crc16();
13 Crc16(const Crc16 &other) = delete;
14 Crc16(Crc16 &&other) = delete;
15 ~Crc16() = default;
16
17 Crc16 &operator=(const Crc16 &other) = delete;
18 Crc16 &operator=(const Crc16 &&other) = delete;
19
20 uint16_t update(const char *data, uint32_t length);
21
22private:
23 uint16_t m_value;
24};
25}// namespace iv::crypto
26#endif//IV_SRC_CRYPTO_CRC16_HPP_
Definition Crc16.hpp:10
Crc16(Crc16 &&other)=delete
uint16_t m_value
Definition Crc16.hpp:23
Crc16 & operator=(const Crc16 &&other)=delete
Crc16(const Crc16 &other)=delete
Crc16()
Definition Crc16.cpp:28
uint16_t update(const char *data, uint32_t length)
Definition Crc16.cpp:33
Crc16 & operator=(const Crc16 &other)=delete
Definition Crc16.cpp:5