chore: add `LICENSE` Despite referring to a "LICENSE" file in the README, I never made such a file. Oops.
refactor: `main.zig` require `huffman.zig` only
chore: fix resource link to Wikipedia
refactor: `xcoding.zig` imports `huffman.zig` only
chore: remove depth tracking in tree creation (1) Did not track depth as one would expect; tracked depth from leaf instead of root. (2) Information was no longer in use by any code.
refactor: modularize tree logic
refactor: modularize frequency logic
chore: update README and bump version
fix: incomplete decoding File decoded stopped prior to encoded `PsuedoEOF` character such that the decoded file was shorter than the original. This resulted from how the record for the `PsuedoEOF` was written into the file header; it was always appended as the final record even when it was, e.g., the second- or third-to-last record. This resulted in some records, including the `PsuedoEOF`, having incorrect lengths and incorrect encodings when the header was decoded. Sometimes, this resulted in the decoding being cut short; in other instances, incorrect symbols were rendered. Solution is to identify the index of the `PsuedoEOF` record in pairs and encode that in the header and no longer encode the symbol itself in the header, removing the need to (i) encode it as two bytes and (ii) place it at the end to handle it specially. When decoding the header, we skip the byte whose index is that of `PsuedoEOF`, insert into the pairs list at the index, and continue as normal.
chore: document `main.zig:{compress * decompress}`
fix: maximum count of codes assigned to length
chore: re-implement decoding test
refactor: extract decoding loop as function
chore: nuked a surviving test
chore: quick documentation
refactor: nuke now-dead code
feat: achieve canonical encoding and decoding Bug fixing abound! * Properly skipped the `PsuedoEOF` bytes in `xcoding.zig:readHuffmanPairsFromHeader`. Previously, only skipped the first byte (`00000001`), shifting the decoding reading frame to the left by one byte. Now we skip the second byte too (`00000000`). * Make `code` in `xcoding.zig:decodedEncodedStream` a `usize` instead of a `u8` because, surprise, Huffman codes can be larger than 8 bits. Should encode this in an explicit constant. * Probably others that have been lost to time in the headache that this project was. Also, add and implement the new `compress` and `decompress` functions. I should decide on what assumptions I want to make on the passed reader and writer, if any, i.e. if I should make new buffers or take them as is. Additionally, the code needs a lot of comments, and a lot of now-dead code has to be removed.
fix: account for header offsets when decoding
fix: write only non-zero lengths
backend implementation of huffman codes