20 Mar
2024
20 Mar
'24
11:18 a.m.
I wrote something like this back in the day: https://github.com/mclow/snippets/blob/master/Base64.hpp
If you look in that repo, you can find tests, and fuzzing tests. No docs, though.
I’d be interested in hearing why (or why not) it fits your needs.
It wouldn't because: * It's hardwired to use exceptions. My use case is a parser for a data format with several base64 fields. It's not exceptional for them to be malformed, so I'd rather use error codes. * The format I'm parsing (P-H-C strings, a way to store hashed passwords - see https://github.com/P-H-C/phc-string-format/blob/master/phc-sf-spec.md) mandates to not output padding characters. Also, I don't see any tests for error cases. Regards, Ruben.