-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
46 lines (34 loc) · 930 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
///////////////////////////////////////////////////////////////////////////////
// file: main.cpp
// Project: ecclab
// Description:
//
// Change history: Apr. 15, 2018 - file created.
// May. 16, 2018 - multi-bit crc.
//
///////////////////////////////////////////////////////////////////////////////
#include "crc.h"
using namespace std;
int main(int argc, char **argv){
// create time
time_t rawtime;
struct tm* timeinfo;
char buffer[80];
time(&rawtime);
timeinfo = localtime(&rawtime);
strftime(buffer,80,"%F_%T",timeinfo);
cout << "crc start!!!" << endl;
cout << "start time = " << buffer << endl;
CRC crc(8); // can enter 4 for crc4, 6, 8, 11, 16, 24
crc.CoutCRCsetting();
crc.CRCcal();
crc.CoutRegVect();
crc.SimplifyRegVect();
crc.CoutFinalRegVect();
cout << "Verification:\n";
crc.RandomizedInput(16);
crc.CoutInput();
crc.CRCcheck();
crc.CoutCRCcyclic();
return 0;
}