From 3c15c1e1d0b25e24da0e7e2996d38ec85184080e Mon Sep 17 00:00:00 2001 From: Mattrixwv Date: Fri, 31 Dec 2021 00:27:06 -0500 Subject: [PATCH] Fixed typos --- Headers/Vigenere.hpp | 10 +++++----- SourceFiles/Autokey.cpp | 1 + SourceFiles/Playfair.cpp | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/Headers/Vigenere.hpp b/Headers/Vigenere.hpp index 5a59dc3..0fb66d2 100644 --- a/Headers/Vigenere.hpp +++ b/Headers/Vigenere.hpp @@ -15,11 +15,11 @@ class Vigenere{ protected: class emptyKeyword{}; //A class to help with error handling - std::string inputString; //This is the string that you want to encode or decode - std::string outputString; //This is the string that is output from encoding or decoding - std::string keyword; //This is the keyword that is the resposible for determining the offsets that you change each character by + std::string inputString; //This is the string that you want to encode or decode + std::string outputString; //This is the string that is output from encoding or decoding + std::string keyword; //This is the keyword that is the resposible for determining the offsets that you change each character by static const std::string version; //The current library's version number - std::vector offset; //This holds the offsets computed from each character in the keyword + std::vector offset; //This holds the offsets computed from each character in the keyword void setOffset(); //Uses keyword to calculate the offset for the Caesar cipher for each character void setInputString(std::string input); //Sets inputString void setKeyword(std::string key); //Sets keyword @@ -30,7 +30,7 @@ public: ~Vigenere(); std::string getInputString() const; //Returns the current inputString std::string getOutputString() const; //Returns the current outputString - std::string getKeyword() const; //Returns the current keyword + std::string getKeyword() const; //Returns the current keyword std::vector getOffsets() const; //Returns the current offsets (Used mostly in bug fixing) std::string encode(std::string key, std::string input); //Encodes input using key and returns the result std::string decode(std::string key, std::string input); //Decodes input using key and returns the result diff --git a/SourceFiles/Autokey.cpp b/SourceFiles/Autokey.cpp index 0bb4798..23b1ebd 100644 --- a/SourceFiles/Autokey.cpp +++ b/SourceFiles/Autokey.cpp @@ -47,6 +47,7 @@ void Autokey::encodeSet(std::string key, std::string input){ //This will take a long time if the keyword in long //Remove the last letter in the string until it is the same size as the input + //TODO: Why not just use substring? while(key.size() > input.size()){ key.erase(key.end() - 1); } diff --git a/SourceFiles/Playfair.cpp b/SourceFiles/Playfair.cpp index 719c620..3de30d4 100644 --- a/SourceFiles/Playfair.cpp +++ b/SourceFiles/Playfair.cpp @@ -48,7 +48,7 @@ void Playfair::createGrid(){ bool found = false; row = column = 0; - //Add any new leters from the keyword to the grid + //Add any new letters from the keyword to the grid //If you reach row 5 then the entire grid has been filled char current; for(unsigned int cnt = 0;(cnt < keyword.size()) && (row < 5);++cnt){