From b94dba6141c2cf7d801655443f7b481fa8f55456 Mon Sep 17 00:00:00 2001 From: Kshitij Date: Mon, 29 Jul 2024 19:57:00 +0530 Subject: [PATCH] Added encoder function Fixed XOR operator TODO - Add boilerplate from syllabus file, then merge with main branch --- Codes/CRC.cpp | 61 +++++++++++++++++++++++++++++++++++++-------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/Codes/CRC.cpp b/Codes/CRC.cpp index 5d61e8c..2e1a9d7 100644 --- a/Codes/CRC.cpp +++ b/Codes/CRC.cpp @@ -2,35 +2,62 @@ #include using namespace std; - string XOR(string data, string key) { // Dividend is data // Divisor is the primary key, i.e. the key string result = ""; - int len = data.length(); + int dataLen = data.length(); + int keyLen = key.length(); - // Performing XOR operation - for (int i=0; i