File Specification
AG Compresion
Description
AG file compression is similar to that of LZ-77.
With some added features to the beginning lines of the file.
LZ-77 compresses repeated data and is formatted by having 2 numbers and a character.
1st integer is the offset.
2nd integer is the size of repeated data.
3rd character is the new character.
Example
book: 00b00o11k
abracadabrad: 00a00b00r31c21d74d
Format
1. Top line will consist of "AG" to indicate file compression type
2. New line "\n"
3. The next characters will indicate the original file type (txt, cpp, pdf, etc.)
4. New line "\n"
5. Orginial file size in bytes
6. New line "\n"
7. All remaining lines are formatted in the LZ-77 compression format.
Example File
AG
txt
12
00a00b00c00o11l11e00f00g00z11x00y
The use of "AG" is to confirm that file is the correct type in order to begin decompression.
We can then grab the file extension and append it to the end of our output file name to generate the original file type.
With the original file size we can then compare the output size of the decompressed file to that of the original file size
to ensure that the decompression was successful in terms of file size.
Decoding Profiling