diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..3a8c479 Binary files /dev/null and b/.DS_Store differ diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..3713c8d --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "python.pythonPath": "/opt/anaconda3/bin/python" +} \ No newline at end of file diff --git a/Decoder.java b/Decoder.java new file mode 100644 index 0000000..43f3874 --- /dev/null +++ b/Decoder.java @@ -0,0 +1,111 @@ +import java.util.*; +import java.io.*; + +// Note: there is something wrong with the encoder that I can't quite figure out. +// every file, when encoded then decoded, begins with the binary sequence 10101100111011010000000000000101 +// -Peter Shen + +public class Decoder { + + // name of method is self-explanatory + public static void decode(String inputFile, String outputFile) throws IOException + { + StringBuilder binaryString = new StringBuilder(); + FileInputStream in = new FileInputStream(inputFile); + PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(outputFile))); + byte[] byteArray = in.readAllBytes(); + + // converts byte array into a giant binary String + for(int i = 0; i < byteArray.length; i++) + { + binaryString.append(toBinary(byteArray[i])); + } + + // sanity check: binary String for accuracy + System.out.println(binaryString); + + ArrayList binaryValues = new ArrayList(); + + // converts the String of binary to an ArrayList of ints, each 9 digits long + for(int i = 0 ;i <= binaryString.length() - 9; i += 9) + { + binaryValues.add(toBinaryValue(binaryString.substring(i, i+9))); + } + + // sanity check: ArrayList for accuracy + System.out.println(binaryValues); + + // initial dictionary values + HashMap map = new HashMap(); + for(int i = 0; i < 256; i++) + map.put(i, "" + (char)i); + + // decoding part, involving dictionary and writing to outputFile + int nextKey = 256; + int current = binaryValues.get(0); + String str = map.get(current); + String ch = "" + str.charAt(0); + out.print(str); + for(int i = 1; i < binaryValues.size(); i++) + { + int next = binaryValues.get(i); + + // adding keys to dictionary, reverse-engineering compression dictionary following LZW rules + if(!map.containsKey(next)) + { + str = map.get(current); + str = str + ch; + } + else + { + str = map.get(next); + } + out.print(str); + ch = "" + str.charAt(0); + map.put(nextKey, map.get(current) + ch); + nextKey++; + current = next; + } + + out.println(); + + out.close(); + } + + // converts number to a String of binary + public static String toBinary(int num) + { + String current = Integer.toBinaryString(num); + StringBuilder str = new StringBuilder(); + while(current.length()+str.length() < 8) + { + str.append("0"); + } + if(current.length() > 8) + { + current = current.substring(current.length() - 8); + } + str.append(current); + return str.toString(); + } + + // converts a binary String into an integer + public static int toBinaryValue(String str) + { + int end = 0; + for(int i = 0; i < 9; i++) + { + if(str.charAt(i) == '1') + { + end += (1 << (8 - i)); + } + } + return end; + } + + // tester + public static void main (String [] args) throws IOException + { + decode("encoded3.bin", "decoded.txt"); + } +} diff --git a/InputFile.txt b/InputFile.txt index fccaafb..a9ef25d 100644 --- a/InputFile.txt +++ b/InputFile.txt @@ -1,5 +1 @@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############################################################&############################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###########################################################&,,,/###########################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########################################################&,,,,,,,&#########################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#################% &##################################&,,,,,,,,,,,&################################### &#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################& .###############################&,,,,,,,,,,,,,,,&###############################& ################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################ &#############################(,,,,,,,&&&,,,,,,,,&############################# &###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############% %###########################&,,,,,,,&&&&&&&,,,,,,,*%########################### ################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################ &#########################&,,,,,,,%&&&&&&&&&&,,,,,,,&########################## &###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#######% *###( ###% &###############&,,,,,,,,&&&&&&&&&&&&&&,,,,,,,&###############% *###% ###& &#######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###### &# &# &###########&,,,,,,,,&&&&&&&&&&&&&&&&&%,,,,,,,&############ &# &# &#####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###### *% (& &##########(,,,,,,,&&&&&&&&&&&&&&&&&&&&&*,,,,,,,&########## ,% /% &#####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#######.%######* %& % %###### %#########&,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,%#########.%######( #& % %###### %######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################/ ## #&################&,,,,,,,%&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,%#################/ ## #&###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################# #% %###############&,,,,,,,*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,&################ #% %################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############* &, # %###########&,,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%,,,,,,,&############/ &, # %##############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############## %# # &########%/,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*,,,,,,,&######### %& #. &#############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#################% *###########&,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,&##########& (#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############################&,,,,,,,%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,###############################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############################&,,,,,,,*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,&############################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##########################&,,,,,,,,&&&&&&&&&&&&&&&%(&&&&&&&&&, ,&&&&&%&&%/&&&&&&&&&&&&&%,,,,,,,&##########################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*########################%/,,,,,,,&&&&&&&&&&&&&&&&&&, , ,, ,, , ,&&&&&&&&&&&&&&&*,,,,,,,&########################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############&&&%#####&&,&,,,,&&&&&&&&&&&&&&&&&&&&&, ,&&&&&&&&&&&&, .&&&,,,,*///&######################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############&,,,,,,&/,&,,,&%&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,,,,,,,,,,,,,,&&&&&&&&&&&, ,,,, ,*&#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############&, ,(, ,&&&&&&&&&&&&&&&&&&#,,,,, ,, ., , ,&&&&&#&&&, ,&###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#############%&&&. %&&&&&&&&&&&&&&&&, ,,,,,, ,,,, , ,&&&&&&&&. ,,, ,&&&&,#&, ,&&/,,%&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########&,,,, ,#&&&&&&&&&&&&, ,&%. .,,. ,.., , ,&&&&&&&, ,&&&&,&*,,&, , ,&#########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########&&&(, ,&&&&&&&&&&&, #&&&&&&,,,,, ,,, . ,&&&&&&&, ,,,, ,&&,,&, ,&##########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############&,&#, .%&&&&&&&&&&&/,, .,,,,..,, , ,, ,%&&&&&&&&&, ,, %&&&&*, ,%**%#######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##########&,,,&, . ,&&&&&&&&&&&&&&&&&,, .,, , , ,, ,,(,,&&&&, ,&,,,%&&&&&&&, ,&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*########&,/,,,,,. ,*&, ,/&&&&&(, , , , , , *&&&&, ., , ,&&&&&&&&&&&, ,&&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*######%*,,,,,*(&&&&&&&, , ,*&&&#, ,,, .,,,, ,. ,, , . ,&&&&&&&&, ,, , ,&&&&&&&# ,&,,,,&######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#####%,,,,,,,&&&&&&&, ,*( ,,..,, , , , , , . , ,&&&&(, ,,&&&, , ,,*. ,(,,,,,&####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###&,,,,,,,&&&&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@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&,,,,,,/&% %& & & #& &* & & &,& %&*,,,,,,&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&,,,,,,,,/&&# #&&/,,,,,,,,&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&#,,,,,,,,,,,,,,,/#%&&&&&&&&&&&&&&&&&&&%#/,,,,,,,,,,,,,,,(&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&%(*,,,,,,,,,,,,,,,,,,,,,,,*(%&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +abcabcabcabcabcabcabcabcabcabcabcabc \ No newline at end of file diff --git a/LZW.java b/LZW.java index f0ebc46..95d7465 100644 --- a/LZW.java +++ b/LZW.java @@ -8,6 +8,7 @@ import java.io.FileInputStream; import java.io.ObjectInputStream; import java.io.IOException; +// import org.apache.commons.io.IOUtils; @@ -15,7 +16,7 @@ public class LZW { private ArrayList compressedAscii; private HashMap dictionary; - private HashMap Invertedictionary; + // private HashMap Invertedictionary; private String fileInAString; private ArrayList inputFileInAnArrayList; private ArrayList preDictionary; @@ -25,23 +26,24 @@ public class LZW private ObjectInputStream is; private BufferedReader input; private ObjectOutputStream os; + private FileInputStream fis; public LZW() throws Exception { decodedFileUnicodeValues = new ArrayList(); dictionary = new HashMap(); - Invertedictionary = new HashMap(); - String fileName = "encoded.bin"; + // Invertedictionary = new HashMap(); + String fileName = "encoded3.bin"; FileOutputStream fileOs = new FileOutputStream(fileName); os = new ObjectOutputStream(fileOs); compressedAscii = new ArrayList(); inputFileInAnArrayList = new ArrayList(); preDictionary = new ArrayList(); update = new ArrayList(); - FileInputStream fileIS = new FileInputStream(fileName); - is = new ObjectInputStream(fileIS); - input = new BufferedReader(new FileReader("InputFile.txt")); - decodedFile = new BufferedWriter(new FileWriter("decoded.txt")); + fis = new FileInputStream(fileName); + is = new ObjectInputStream(fis); + input = new BufferedReader(new FileReader("lzw-file3.txt")); + // decodedFile = new BufferedWriter(new FileWriter("decoded2.txt")); fileInAString = ""; } @@ -92,8 +94,8 @@ else if(preDictionary.contains(temp+temp2) == true) public void dictionaryPopulators() { - int counter = 257; - for(int i = 0; i < 257; i++) + int counter = 256; + for(int i = 0; i < 256; i++) { char ascii = (char) i; dictionary.put(Character.toString(ascii), i); @@ -104,16 +106,7 @@ public void dictionaryPopulators() } //inverted dictionary is dictionary with values and keys swapped places - counter = 257; - for(int i = 0; i < 257; i++) - { - char ascii = (char) i; - Invertedictionary.put(i, Character.toString(ascii)); - } - for(int k = 0; k < preDictionary.size(); k++) - { - Invertedictionary.put(counter+k, preDictionary.get(k)); - } + } @@ -152,14 +145,42 @@ public void convertIntValuesToBinary()throws Exception }catch(IOException e){ } } - for(int i = 0; i < decodedFileUnicodeValues.size(); i++) - { - int temp = decodedFileUnicodeValues.get(i); - decodedFile.write(Invertedictionary.get(temp)); - } - decodedFile.close(); } +// public void decode() throws Exception +// { +// // int byteRead; +// // String decoded = ""; +// // while ((byteRead = fis.read()) != -1); +// // { +// // decoded += byteRead; +// // } +// // System.out.println(decoded); +// String body = IOUtils.toString(fis, StandardCharsets.UTF_8.name()); + +// } + +// public void decode() throws Exception +// { +// int counter = 256; +// for(int i = 0; i < 256; i++) +// { +// char ascii = (char) i; +// Invertedictionary.put(i, Character.toString(ascii)); +// } +// for(int k = 0; k < preDictionary.size(); k++) +// { +// Invertedictionary.put(counter+k, preDictionary.get(k)); +// } + +// for(int i = 0; i < decodedFileUnicodeValues.size(); i++) +// { +// int temp = decodedFileUnicodeValues.get(i); +// decodedFile.write(Invertedictionary.get(temp)); +// } +// decodedFile.close(); +// } + public void fileEncoder()throws Exception { convertFileStringToArrayDictionary(); @@ -167,8 +188,9 @@ public void fileEncoder()throws Exception fileCompressor(); } - public static void main(String[] args)throws Exception - { - - } +public static void main(String[] args)throws Exception +{ + LZW thing = new LZW(); + thing.fileEncoder(); +} } diff --git a/decoded.txt b/decoded.txt index 09bdfc3..e69de29 100644 --- a/decoded.txt +++ b/decoded.txt @@ -1 +0,0 @@ -@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############################################################&############################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###########################################################&,,,/###########################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########################################################&,,,,,,,&#########################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#################% &##################################&,,,,,,,,,,,&################################### &#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################& .###############################&,,,,,,,,,,,,,,,&###############################& ################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################ &#############################(,,,,,,,&&&,,,,,,,,&############################# &###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############% %###########################&,,,,,,,&&&&&&&,,,,,,,*%########################### ################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################ &#########################&,,,,,,,%&&&&&&&&&&,,,,,,,&########################## &###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#######% *###( ###% &###############&,,,,,,,,&&&&&&&&&&&&&&,,,,,,,&###############% *###% ###& &#######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###### &# &# &###########&,,,,,,,,&&&&&&&&&&&&&&&&&%,,,,,,,&############ &# &# &#####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###### *% (& &##########(,,,,,,,&&&&&&&&&&&&&&&&&&&&&*,,,,,,,&########## ,% /% &#####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#######.%######* %& % %###### %#########&,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,%#########.%######( #& % %###### %######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################/ ## #&################&,,,,,,,%&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,%#################/ ## #&###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################# #% %###############&,,,,,,,*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,&################ #% %################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############* &, # %###########&,,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%,,,,,,,&############/ &, # %##############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############## %# # &########%/,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*,,,,,,,&######### %& #. &#############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#################% *###########&,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,&##########& (#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############################&,,,,,,,%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,###############################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############################&,,,,,,,*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,&############################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##########################&,,,,,,,,&&&&&&&&&&&&&&&%(&&&&&&&&&, ,&&&&&%&&%/&&&&&&&&&&&&&%,,,,,,,&##########################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*########################%/,,,,,,,&&&&&&&&&&&&&&&&&&, , ,, ,, , ,&&&&&&&&&&&&&&&*,,,,,,,&########################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############&&&%#####&&,&,,,,&&&&&&&&&&&&&&&&&&&&&, ,&&&&&&&&&&&&, .&&&,,,,*///&######################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############&,,,,,,&/,&,,,&%&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,,,,,,,,,,,,,,&&&&&&&&&&&, ,,,, ,*&#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############&, ,(, ,&&&&&&&&&&&&&&&&&&#,,,,, ,, ., , ,&&&&&#&&&, ,&###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#############%&&&. %&&&&&&&&&&&&&&&&, ,,,,,, ,,,, , ,&&&&&&&&. ,,, ,&&&&,#&, ,&&/,,%&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########&,,,, ,#&&&&&&&&&&&&, ,&%. .,,. ,.., , ,&&&&&&&, ,&&&&,&*,,&, , ,&#########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########&&&(, ,&&&&&&&&&&&, #&&&&&&,,,,, ,,, . ,&&&&&&&, ,,,, ,&&,,&, ,&##########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############&,&#, .%&&&&&&&&&&&/,, .,,,,..,, , ,, ,%&&&&&&&&&, ,, %&&&&*, ,%**%#######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##########&,,,&, . ,&&&&&&&&&&&&&&&&&,, .,, , , ,, ,,(,,&&&&, ,&,,,%&&&&&&&, ,&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*########&,/,,,,,. ,*&, ,/&&&&&(, , , , , , *&&&&, ., , ,&&&&&&&&&&&, ,&&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*######%*,,,,,*(&&&&&&&, , ,*&&&#, ,,, .,,,, ,. ,, , . ,&&&&&&&&, ,, , ,&&&&&&&# ,&,,,,&######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#####%,,,,,,,&&&&&&&, ,*( ,,..,, , , , , , . , ,&&&&(, ,,&&&, , ,,*. ,(,,,,,&####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@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@@@@@@@@@@@@@@@@@@&%,,,,,(& & & ,&,,,,, \ No newline at end of file diff --git a/decoded2.txt b/decoded2.txt new file mode 100644 index 0000000..e69de29 diff --git a/encoded1.bin b/encoded1.bin new file mode 100644 index 0000000..711006c Binary files /dev/null and b/encoded1.bin differ diff --git a/encoded2.bin b/encoded2.bin new file mode 100644 index 0000000..711006c Binary files /dev/null and b/encoded2.bin differ diff --git a/encoded3.bin b/encoded3.bin new file mode 100644 index 0000000..517577f Binary files /dev/null and b/encoded3.bin differ diff --git a/lzw-file1.txt b/lzw-file1.txt new file mode 100644 index 0000000..a9ef25d --- /dev/null +++ b/lzw-file1.txt @@ -0,0 +1 @@ +abcabcabcabcabcabcabcabcabcabcabcabc \ No newline at end of file diff --git a/lzw-file2.txt b/lzw-file2.txt new file mode 100644 index 0000000..7e75d29 --- /dev/null +++ b/lzw-file2.txt @@ -0,0 +1 @@ +abcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcdefgabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcdefgabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabcabc \ No newline at end of file diff --git a/lzw-file3.txt b/lzw-file3.txt new file mode 100644 index 0000000..20fb9d1 --- /dev/null +++ b/lzw-file3.txt @@ -0,0 +1,83 @@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############################################################&############################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###########################################################&,,,/###########################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########################################################&,,,,,,,&#########################################################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#################% &##################################&,,,,,,,,,,,&################################### &#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################& .###############################&,,,,,,,,,,,,,,,&###############################& ################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################ &#############################(,,,,,,,&&&,,,,,,,,&############################# &###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############% %###########################&,,,,,,,&&&&&&&,,,,,,,*%########################### ################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################ &#########################&,,,,,,,%&&&&&&&&&&,,,,,,,&########################## &###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#######% *###( ###% &###############&,,,,,,,,&&&&&&&&&&&&&&,,,,,,,&###############% *###% ###& &#######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###### &# &# &###########&,,,,,,,,&&&&&&&&&&&&&&&&&%,,,,,,,&############ &# &# &#####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###### *% (& &##########(,,,,,,,&&&&&&&&&&&&&&&&&&&&&*,,,,,,,&########## ,% /% &#####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#######.%######* %& % %###### %#########&,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,%#########.%######( #& % %###### %######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################/ ## #&################&,,,,,,,%&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,%#################/ ## #&###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*################# #% %###############&,,,,,,,*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,&################ #% %################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############* &, # %###########&,,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&%,,,,,,,&############/ &, # %##############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############## %# # &########%/,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&*,,,,,,,&######### %& #. &#############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#################% *###########&,,,,,,,&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,&##########& (#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############################&,,,,,,,%&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,###############################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############################&,,,,,,,*&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,&############################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##########################&,,,,,,,,&&&&&&&&&&&&&&&%(&&&&&&&&&, ,&&&&&%&&%/&&&&&&&&&&&&&%,,,,,,,&##########################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*########################%/,,,,,,,&&&&&&&&&&&&&&&&&&, , ,, ,, , ,&&&&&&&&&&&&&&&*,,,,,,,&########################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############&&&%#####&&,&,,,,&&&&&&&&&&&&&&&&&&&&&, ,&&&&&&&&&&&&, .&&&,,,,*///&######################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##############&,,,,,,&/,&,,,&%&&&&&&&&&&&&&&&&&&&&&&&,,,,,,,,,,,,,,,,,,,,,&&&&&&&&&&&, ,,,, ,*&#################&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###############&, ,(, ,&&&&&&&&&&&&&&&&&&#,,,,, ,, ., , ,&&&&&#&&&, ,&###############&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#############%&&&. %&&&&&&&&&&&&&&&&, ,,,,,, ,,,, , ,&&&&&&&&. ,,, ,&&&&,#&, ,&&/,,%&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########&,,,, ,#&&&&&&&&&&&&, ,&%. .,,. ,.., , ,&&&&&&&, ,&&&&,&*,,&, , ,&#########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#########&&&(, ,&&&&&&&&&&&, #&&&&&&,,,,, ,,, . ,&&&&&&&, ,,,, ,&&,,&, ,&##########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*############&,&#, .%&&&&&&&&&&&/,, .,,,,..,, , ,, ,%&&&&&&&&&, ,, %&&&&*, ,%**%#######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*##########&,,,&, . ,&&&&&&&&&&&&&&&&&,, .,, , , ,, ,,(,,&&&&, ,&,,,%&&&&&&&, ,&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*########&,/,,,,,. ,*&, ,/&&&&&(, , , , , , *&&&&, ., , ,&&&&&&&&&&&, ,&&########&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*######%*,,,,,*(&&&&&&&, , ,*&&&#, ,,, .,,,, ,. ,, , . ,&&&&&&&&, ,, , ,&&&&&&&# ,&,,,,&######&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#####%,,,,,,,&&&&&&&, ,*( ,,..,, , , , , , . , ,&&&&(, ,,&&&, , ,,*. ,(,,,,,&####&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*###&,,,,,,,&&&&&&&&&&&&, .,, , , ., . , . , ,&, .,,&&&&&&&&&&* ., ,, ,&&&,,,,,,,*%##&,,,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&,,*#&,,,,,,,*&&&&&&&&&&&&&&&, ,*, , , ,, , , , , (&&&%&&&&&&&&&&&&&&&&,, ,, ,&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@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&,,,,,,,,/&&# #&&/,,,,,,,,&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&#,,,,,,,,,,,,,,,/#%&&&&&&&&&&&&&&&&&&&%#/,,,,,,,,,,,,,,,(&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ +@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@&&&&&%(*,,,,,,,,,,,,,,,,,,,,,,,*(%&&&&@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ \ No newline at end of file diff --git a/readme.txt b/readme.txt index 5fedea5..7ebe731 100644 --- a/readme.txt +++ b/readme.txt @@ -3,4 +3,8 @@ I then put that through the c+n algorithm and add all the values to prediction there is an arraylist of strings called update which is the output that andrew listed in his example chart i then populated the dictionary(hashmap) and added the vars to that and i also made an inverted key and value dictionary called invertedictionary I had another array of integers where i went through the update list and turned the value to their corresponding dictionary key and put it into an array of integers called decodedFileUnicodeValues -i then convert decodedFileUnicodeValues to binary and ouput them to the .bin file \ No newline at end of file +i then convert decodedFileUnicodeValues to binary and ouput them to the .bin file + + +Peter Shen's notes: +There is something wrong with the encoder that I can't quite figure out. Every file, when encoded then decoded, begins with the binary sequence 10101100111011010000000000000101, which returns dictionary values of 345, 436, 0. Shorter files don't return anything at all when decoded, while longer files still retain a lot of their original info, but can't be decoded because there doesn't exist anything at keys 345 and 436 in the dictionary at the very beginning. \ No newline at end of file