X-Git-Url: https://git.teslayout.com/public/public/public/?a=blobdiff_plain;f=include%2Fanna%2Fcore%2Ffunctions.hpp;h=58b8cd882bcc84380996007b12661273b4ceae82;hb=eb446c670d53aa275d78b366ef1faf2b32ca964e;hp=3c372274fc5923b0d96426d5cfcc0129cd27173b;hpb=94fc4366adedbf26ca6ef3104f88d41fa85f5a72;p=anna.git diff --git a/include/anna/core/functions.hpp b/include/anna/core/functions.hpp index 3c37227..58b8cd8 100644 --- a/include/anna/core/functions.hpp +++ b/include/anna/core/functions.hpp @@ -103,22 +103,6 @@ struct functions { */ static std::string asString(const unsigned int number) throw(); - /** - \param number Numero a convertir. - @return Un literal con el numero sin signo convertido a cadena decimal. - */ - static std::string asString(const unsigned long long int number) throw() { - return asString((U64)number); - } - - /** - \param number Numero a convertir. - @return Un literal con el numero sin signo convertido a cadena decimal. - */ - static std::string asString(const long long int number) throw() { - return asString((S64)number); - } - /** Devuelve un literal con tel numero convertido a cadena decimal @return Un literal con el numero signo convertido a cadena decimal. @@ -1113,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); }; }