Updating tests
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
//CipherStreamJava/src/main/java/com/mattrixwv/CipherStreamJava/Autokey.java
|
||||
//Mattrixwv
|
||||
// Created: 07-25-21
|
||||
//Modified: 04-15-23
|
||||
//Modified: 05-04-23
|
||||
package com.mattrixwv.cipherstream.monosubstitution;
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ import com.mattrixwv.cipherstream.exceptions.InvalidKeywordException;
|
||||
|
||||
|
||||
public class Autokey extends Vigenere{
|
||||
protected static Logger logger = LoggerFactory.getLogger(Autokey.class);
|
||||
private static final Logger logger = LoggerFactory.getLogger(Autokey.class);
|
||||
|
||||
|
||||
//Special rules for setting the strings for encoding
|
||||
protected void encodeSet(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
|
||||
@@ -57,7 +58,7 @@ public class Autokey extends Vigenere{
|
||||
}
|
||||
//Decodes the inputString
|
||||
@Override
|
||||
protected String decode(){
|
||||
protected void decode(){
|
||||
logger.debug("Decoding");
|
||||
|
||||
//Decode what the key will allow, add that to the key and continue
|
||||
@@ -109,7 +110,6 @@ public class Autokey extends Vigenere{
|
||||
//Save and return the results
|
||||
outputString = fullOutput.toString();
|
||||
logger.debug("Saving output string '{}'", outputString);
|
||||
return outputString;
|
||||
}
|
||||
|
||||
|
||||
@@ -125,13 +125,15 @@ public class Autokey extends Vigenere{
|
||||
public String encode(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
|
||||
reset();
|
||||
encodeSet(keyword, inputString);
|
||||
return encode();
|
||||
encode();
|
||||
return outputString;
|
||||
}
|
||||
//Decodes inputString using the Autokey cipher
|
||||
@Override
|
||||
public String decode(String keyword, String inputString) throws InvalidKeywordException, InvalidInputException{
|
||||
reset();
|
||||
decodeSet(keyword, inputString);
|
||||
return decode();
|
||||
decode();
|
||||
return outputString;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user