I’ve just published elm-tiny-inflate, a package that decompresses deflated data (e.g. zip, png and woff).
These formats compress their data. For instance zip will store the filename of the zipped file and some other stuff (uncompressed), but compresses the file contents using a deflate algorithm.
This package will remove the compression, returning the uncompressed Bytes
that can then be further decoded with elm/bytes
. I’ve already started work on woff, and (a subset of) zip seems feasible.
Aside: This package has a special Decoder
type for bits (it uses Bytes.Decode
under the hood, decoding more bytes as needed). This is useful when data can cross byte boundaries (e.g. to decode 3 3-bit numbers). I suspect this is a niche functionality only used for compression and such, but if you do have a use case for this let me know.