// Copyright (C) FYT Vision Group. All rights reserved.

#ifndef RM_SERIAL_DRIVER_CRC8_HPP_
#define RM_SERIAL_DRIVER_CRC8_HPP_

#include <cstddef>
#include <cstdint>

namespace fyt::serial_driver {

constexpr uint8_t kCrc8Init = 0xff;

uint8_t GetCrc8(const uint8_t *data, size_t len, uint8_t init = kCrc8Init);
bool VerifyCrc8(const uint8_t *data, size_t len);
void AppendCrc8(uint8_t *data, size_t len);

}  // namespace fyt::serial_driver

#endif  // RM_SERIAL_DRIVER_CRC8_HPP_
