00001 /********************************************************************* 00002 * C_Base64 - a simple base64 encoder and decoder. 00003 * 00004 * Copyright (c) 1999, Bob Withers - bwit@pobox.com 00005 * 00006 * This code may be freely used for any purpose, either personal 00007 * or commercial, provided the authors copyright notice remains 00008 * intact. 00009 *********************************************************************/ 00010 00011 #ifndef __BASE64_HPP__ 00012 #define __BASE64_HPP__ 00013 00014 #include <string> 00015 00016 namespace ipsi 00017 { 00019 const char fillchar = '='; 00020 00021 // 00000000001111111111222222 00022 // 01234567890123456789012345 00023 static std::string cvt = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" 00024 00025 // 22223333333333444444444455 00026 // 67890123456789012345678901 00027 "abcdefghijklmnopqrstuvwxyz" 00028 00029 // 555555556666 00030 // 234567890123 00031 "0123456789+/"; 00032 00052 class Base64 00053 { 00054 public: 00063 static std::string encode(std::string data); 00064 }; 00065 } 00066 #endif