Description
It'd be great to polish this crate and make it stable with idiomatic API and good documentation. Since this crate appears stale I'm willing to help maintain it to make the progress a bit faster.
I'm still unsure what all those traits do, they seem to be meant as extension traits?
Thinking about ideal API, I identified these basic building blocks:
u5
type- converting stream of
u8
to stream ofu5
and back - calculating checksum
- converting stream of
u8
to ASCII and back
I think each deserves its own module, maybe even crate. The commonly used things can still be flattened for consumers.
u5 type
I think this is good as is. Could add impl TryFrom<*> for u5
and arithmetic functions for completeness.
u8-u5 conversion
The API should enable to perform this conversion without allocation by having wrappers around iterators.
Convenience functions for slices and Vec
s can be added but not sure how important given .iter()
and .collect()
are easy to call.
This should also provide free-standing functions to calculate encoded/decoded lengths.
checksum calculation
The API should be similar to hashers with possible convenience to compute from iterators.
It should also provide a wrapper for the case when checksum is calculated together with conversions.
u8-ASCII conversion
Should be similar to u8
-u5
conversion. Might be useful to provide wrappers returning both ASCII u8
and char
to avoid overhead when writing to writer
. Also maybe provide a method to construct String
without unnecessary UTF-8 check (using unsafe
internally).
Facade
Convenience functions for converting stream of u8
to strings (with/without checksum) and back should be provided.
Also for consideration: exploit the invariant of u5
to skip bounds checks when converting to char
.