Cyclic Redundancy Code - Final (with Receiver Side ) #1
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
/*
#include
#include
using namespace std;
// Function to perform XOR operation
string XOR(string a, string b) {
string result = "";
for (int i = 0; i < a.length(); i++) {
result += (a[i] == b[i]) ? '0' : '1';
}
return result;
}
// Function to encode data using CRC
string encoder(string data, string key) {
int keyLen = key.length();
int dataLen = data.length();
}
// Function to perform CRC division and find the remainder
string performDivision(string data, string key) {
int keyLen = key.length();
}
// Function to check the correctness of received data
bool checkData(string data, string key) {
string remainder = performDivision(data, key);
return (remainder.find('1') == string::npos); // No '1' means remainder is all zeros
}
int main() {
string data, key;
}
*/
The
XOR
function has been kept as is from testing branch. TheperformDivision
andcheckData
functions have been added, along with some modifications to themain
function.Check the code here.