Goal
I was inspired to add chunk compression, after thinking about it yesterday.
Plan
- Add compression using the flate2 crate, in a way that the compression can be undone transparently.
- Since compression can, at least in principle, fail, some interface changes may be necessary to make operations fallible.
Notes
- Add a
plain text data
type, as anenum
with compressed and uncompressed variants. Later, if there's a need, this allows adding more compression methods. - The
flate2
library is pretty straightforward to use, but it exposes details I don't want to worry about, so I wrote simple wrappers to compress and decompress data in memory.
Summary
This was a fun Sunday morning hack.
Comments?
If you have feedback on this development session, please use the following fediverse thread: https://toot.liw.fi/@liw/114645941902760151.