
Hi all! Is there any interest in a library for base64 encoding? Something like this: int main() { base64_encoder encode; std::string pure = "Hello world!"; std::string enc; encode( pure, enc ); // In enc: SGVsbG8gd29ybGQh ... } Library uses boost::dynamic_bitset. Denis -- View this message in context: http://old.nabble.com/Library-for-base64-tp28561821p28561821.html Sent from the Boost - Dev mailing list archive at Nabble.com.

Zitat von deninok <shev.denis@gmail.com>:
Hi all!
Is there any interest in a library for base64 encoding?
http://www.boost.org/doc/libs/1_43_0/libs/serialization/doc/dataflow.html

on 14.05.2010 at 20:55 deninok wrote :
Hi all!
Is there any interest in a library for base64 encoding?
Something like this:
int main() { base64_encoder encode;
std::string pure = "Hello world!"; std::string enc;
encode( pure, enc ); // In enc: SGVsbG8gd29ybGQh ... }
Library uses boost::dynamic_bitset.
actually i'm not interested in such a lib yet i just have a suggestion: it's better to use type encode(const type &src); instead of void encode(const type &src, type &dest); such that the use case becomes std::string enc = encode(pure); -- Pavel P.S. if you notice a grammar mistake or weird phrasing in my message please point it out

DE-11 wrote:
it's better to use
type encode(const type &src);
instead of
void encode(const type &src, type &dest);
such that the use case becomes
std::string enc = encode(pure);
You are right, but what if length of enc is 1000000 symbols or more? Copying (in return operation) will be expensive. -- View this message in context: http://old.nabble.com/Library-for-base64-tp28561821p28566205.html Sent from the Boost - Dev mailing list archive at Nabble.com.

On 15 May 2010 06:23, deninok <shev.denis@gmail.com> wrote:
You are right, but what if length of enc is 1000000 symbols or more? Copying (in return operation) will be expensive.
Well, http://cpp-next.com/archive/2009/08/want-speed-pass-by-value/ That said, I prefer the enc(a, b); form because it allows b to be something other than a std::string without needing to to write out the name of the type. I think what you'll find is that to be accepted, the library will need to offer far more than just a std::string -> std::string interface. At a very minimum it should be able to read from/append to a vector<char>, and it should probably offer something like a streambuf adaptor as well so that it can be used non-invasively.

Scott McMurray-2 wrote:
I think what you'll find is that to be accepted, the library will need to offer far more than just a std::string -> std::string interface. At a very minimum it should be able to read from/append to a vector<char>, and it should probably offer something like a streambuf adaptor as well so that it can be used non-invasively.
Of course, Scott, of course! std::string -> std::string is just trivial example. This library will works with STL-containers (where value_type is 'char' and 'unsigned char'). In addition it will works with std::fstream (for example, if we want encode image file directly). -- View this message in context: http://old.nabble.com/Library-for-base64-tp28561821p28566957.html Sent from the Boost - Dev mailing list archive at Nabble.com.

Hi all!
Is there any interest in a library for base64 encoding?
If you are searching for a C++ base64 library, then you may want to take a look at the base64 encoding/decoding routines from the stringencoders project. I haven't tried them, but these routines are purportedly very efficient: http://code.google.com/p/stringencoders/source/browse/trunk/src/modp_b64.h

Daniel Trebbien wrote:
... you may want to take a look at the base64 encoding/decoding routines from the stringencoders project. http://code.google.com/p/stringencoders/source/browse/trunk/src/modp_b64.h
It is not "C++-oriented" code (C-pointers, etc). -- View this message in context: http://old.nabble.com/Library-for-base64-tp28561821p28566234.html Sent from the Boost - Dev mailing list archive at Nabble.com.

deninok wrote:
Daniel Trebbien wrote:
... you may want to take a look at the base64 encoding/decoding routines from the stringencoders project.
<http://code.google.com/p/stringencoders/source/browse/trunk/src/modp_b64.h>
It is not "C++-oriented" code (C-pointers, etc).
Nevertheless, it could be instructive. _____ Rob Stewart robert.stewart@sig.com Software Engineer, Core Software using std::disclaimer; Susquehanna International Group, LLP http://www.sig.com IMPORTANT: The information contained in this email and/or its attachments is confidential. If you are not the intended recipient, please notify the sender immediately by reply and immediately delete this message and all its attachments. Any review, use, reproduction, disclosure or dissemination of this message or any attachment by an unintended recipient is strictly prohibited. Neither this message nor any attachment is intended as or should be construed as an offer, solicitation or recommendation to buy or sell any security or other financial instrument. Neither the sender, his or her employer nor any of their respective affiliates makes any warranties as to the completeness or accuracy of any of the information contained herein or that this message or any of its attachments is free of viruses.

deninok wrote:
Is there any interest in a library for base64 encoding?
Something like this:
int main() { base64_encoder encode;
std::string pure = "Hello world!"; std::string enc;
encode( pure, enc ); // In enc: SGVsbG8gd29ybGQh ... }
My own effort at base64 decoding as an iterator adaptor is here, in case anyone is interested: http://svn.chezphil.org/libpbe/trunk/include/base64.hh Regards, Phil.
participants (8)
-
Daniel Trebbien
-
DE
-
deninok
-
Nelson, Erik - 2
-
Phil Endecott
-
Scott McMurray
-
Stewart, Robert
-
strasser@uni-bremen.de