This is the practice project to explore various golang concepts. In this project we are building Compression Tool.
NOTE: This project is part of the Coding Challenge Repo. Building A Huffman Encoder/Decoder
Download the sample test file from here
-
Accept filename as input and check if the file is valid and readable or not. If not throw error.
-
Determine the frequency of every character in the input file.
-
Build a binary tree from the frequency
-
Generate a prefix code table from the tree
-
Encode the text using code table.
-
Encode the tree - we'll need to include this in this in the output file so we can decode it.
-
Write the encoded tree and text to an output file.
-
Add the description function
-
Gloss-up the application using Charm tools
Download binary respective the device from here
Then extract from the archived folder.
Using Compactor CLI You can perform 2 operations in the compactor CLI
- Compression
- Default operation, no need to pass argument for compression apart from required flags:
-
./compactor -h
-
- Default operation, no need to pass argument for compression apart from required flags:
- Decompression
- For decompressing the compressed file you need to pass
decarg with required flags:-
./compactor dec -h
-
- For decompressing the compressed file you need to pass
Flags:
-h: This is the help flag to explain all the arguments and functionality of the operation.-i: [Required] This flag is required and will be pointing to the file that needs to be compressed or the compressed file which needs to be decompressed.-o: [Optional] This flag is optional, if not provided it will use the-ipath to determine the output file