base64.hpp
1 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil -*- */
22 #ifndef NDN_BASE64_HPP
23 #define NDN_BASE64_HPP
24 
25 #include <string>
26 #include <vector>
27 #include <ndn-cpp/common.hpp>
28 
29 namespace ndn {
30 
39 std::string
40 toBase64(const uint8_t* array, size_t arrayLength, bool addNewlines = false);
41 
49 static std::string
50 toBase64(const std::vector<uint8_t>& array, bool addNewlines = false)
51 {
52  return toBase64(&array[0], array.size(), addNewlines);
53 }
54 
61 void
62 fromBase64(const std::string& input, std::vector<uint8_t>& output);
63 
64 
65 }
66 
67 #endif
Copyright (C) 2013-2016 Regents of the University of California.
Definition: common.hpp:35
string toBase64(const uint8_t *array, size_t arrayLength, bool addNewlines)
Return the base64 representation of the bytes in array.
Definition: base64.cpp:34