Boost logo

Boost Users :

Subject: [Boost-users] Base64 encoding
From: John M. Dlugosz (mpbecey7gu_at_[hidden])
Date: 2011-09-28 15:15:58


I followed a recipe for using Boost libraries to perform a base64-encoding of some data,
as explained here
(http://stackoverflow.com/questions/7053538/how-do-i-encode-a-string-to-base64-using-only-boost).

However, it gives the wrong result. For example, I expect a string to end with "…8EAA=="
and instead I get a total length two chars shorter, ending with "…8EAM".

More use of google turns up that boost::archive::iterators::base64_from_binary only works
for inputs that are a multiple of three bytes, and I can't find any proper documentation
on how to use this.

Is there function that wraps base64_from_binary that works on any input? Or is it not
worth trying to use this Boost library at all?

Thanks,
—John


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net