-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrc_example.cpp.cpp
More file actions
22 lines (16 loc) · 604 Bytes
/
crc_example.cpp.cpp
File metadata and controls
22 lines (16 loc) · 604 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// crc_example.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
import crc;
import std;
int main()
{
std::vector<std::uint8_t> data = { 0x01, 0x02, 0x03, 0x04, 0x05 }; // Example data
size_t dataSize = data.size();
// Calculate CRC32 checksum
std::bitset<32> crcResult = crc::calculateCRC32(data.data(), dataSize);
// Output the CRC32 checksum in binary format
std::cout << "CRC32 checksum (binary): " << crcResult << std::endl;
return 0;
}
//g++ - std = c++20 - fmodules - ts crc.cppm main.cpp - o crc_example
//. / crc_example