I think, a BaseN library (with N being at least 16 and 64) with high performance (i.e. with SIMD support) and configurability would be useful. The particular points of configuration and capabilities I'm interested in:
Looks like the two more widespread bases. Seems reasonable.
- Character set. For Base16 - upper or lower-case letters. For Base64 - normal or URL-safe[1] character set.
Definitely.
- For Base64, whether to include trailing padding on encoding.
This is actually one of the requirements that motivated me to think of this project.
- For decoding, support error indication via exception or an error code.
And this is the other one. I might go with system::result, which joins the best of the two worlds.
- Support output into an externally provided buffer. This also implies that the library must provide means to estimate the size of that buffer for a given input. Support for output in unallocated buffer (e.g. via std::back_inserter) is also welcome, but not a strong requirement.
Yes, that's mandatory. I'm not convinced of the std::back_inserter one, though.
- Zero allocation, context-less mode. I.e. a function taking inputs and outputs and doing the whole job in one go.
Seems reasonable, too.
I would be interested in a Boost library, not a standalone version.
There are plenty implementations out there (for example, in OpenSSL), so the proposed library will need to have a comparison, including performance, with popular alternatives in the docs.
I attempted to use the OpenSSL implementation and found it quite frustrating. Regards, Ruben.