X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fcore%2Ffunctions.hpp;h=58b8cd882bcc84380996007b12661273b4ceae82;hb=eb446c670d53aa275d78b366ef1faf2b32ca964e;hp=382a625a40f1b3af33acfee79cb741e35d7d0bd4;hpb=cc05f3d8a5100af6415f9520813e3326f7ffd69f;p=anna.git diff --git a/include/anna/core/functions.hpp b/include/anna/core/functions.hpp index 382a625..58b8cd8 100644 --- a/include/anna/core/functions.hpp +++ b/include/anna/core/functions.hpp @@ -1097,6 +1097,28 @@ struct functions { * @param target Isup number octet string. */ static void codeIsupNumber(const isup_number_t & isupNumber, bool calledOrCalling, std::string & target) throw(RuntimeException); + + /** + * Base64 encoding + * + * @param str String to be encoded + * + * @return Returns encoded representation + */ + static std::string encodeBase64(const U8* buf, unsigned int bufLen); + static std::string encodeBase64(const std::string & str) + { + return encodeBase64((const U8 *)str.c_str(), str.size()); + } + + /** + * Base64 decoding + * + * @param encodedString Encoded base64 representation + * + * @return Returns decoded representation + */ + static std::string decodeBase64(const std::string & encodedString); }; }