Skip to content

sablinkv/CRC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CRC

Cyclic redundancy check algorithm.

Building

The following commands build the project.

mkdir build
cd build
cmake ..
cmake --build .

Development

The following command builds the project and runs the tests.

cmake ..
cmake --build . --config Degub/Release
ctest -C Debug/Release

Usage

#include <crc.hpp>
#include <iostream>
#include <string>
#include <vector>

int main() {
  const std::string Text("Some string 1234567890");
  CRC32::DEFAULT crc32;
  auto result_crc32 = crc32(Text.begin(), Text.end());
  
  const std::vector<std::uint8_t> ByteArray({ 0x10, 0x38, 0x24, 0x13, 0x75, 0x63, 0x1, 0x0, 0x58 });
  CRC16::MODBUS crc16;
  auto result_crc16 = crc16(ByteArray.data(), ByteArray.size());

  return 0;
}

Releases

No releases published

Packages

No packages published