base64.h 441 B

12345678910111213141516171819202122232425262728
  1. #ifndef BASE64_H
  2. #define BASE64_H
  3. #include <string>
  4. #include <vector>
  5. namespace base64 {
  6. /**
  7. * Decodes base64 encoded strings.
  8. *
  9. * @param val base64 encoded string
  10. *
  11. * @return decoded data
  12. */
  13. template <typename T> T decode(const std::string &val);
  14. /**
  15. * Encodes a string to base64.
  16. *
  17. * @param val data
  18. *
  19. * @return base64 encoded string
  20. */
  21. template <typename T> std::string encode(const T &val);
  22. } // namespace base64
  23. #endif