Crystal allows to put arbitrary byte values into strings even if they aren't valid UTF-8.
This is 30% more space-efficient than Base64 encoding which translates directly to the size of the compiled binary.
Unfortunately there exists no literal for Slice right now (but there is a discussion about this in crystal-lang/crystal#2886) so we need to resort to strings for this. It is a bit hacky but look like it works 👍
It also includes a refactoring of the API exposed by BakedFile, including making it an IO and deprecating several methods that can be replaced by using the file as an IO.
Crystal allows to put arbitrary byte values into strings even if they aren't valid UTF-8.
This is 30% more space-efficient than Base64 encoding which translates directly to the size of the compiled binary.
Unfortunately there exists no literal for Slice right now (but there is a discussion about this in crystal-lang/crystal#2886) so we need to resort to strings for this. It is a bit hacky but look like it works 👍
It also includes a refactoring of the API exposed by
BakedFile
, including making it anIO
and deprecating several methods that can be replaced by using the file as anIO
.Based on #11