Closed mamantoha closed 6 years ago
Sorry, there are technical reasons we can't implement those APIs, on top of design reasons why we don't want to implement them anyway.
As @Papierkorb said, IO
is typically how you want to represent binary data waiting to be decoded, then you can use IO#read_bytes
and IO#write_bytes
to replace most usecases of unpack
and pack
respectively.
Please drop by gitter or the mailing list if you need help with a specific example.
That API isn't really a good fit for Crystal. Strings are not for binary data, and Array isn't a suitable container for such "unpacked" data.
A sane API, maybe using the mapping pattern, would be much much better, safe and actually usable.