1 // Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
2 // Use of this source code is governed by a apache 2.0 license that can be
3 // found in the LICENSE file.
5 #include "common/utils/base64.h"
7 #include <boost/archive/iterators/base64_from_binary.hpp>
8 #include <boost/archive/iterators/transform_width.hpp>
14 namespace bai = boost::archive::iterators;
18 typedef bai::base64_from_binary<bai::transform_width<const char*, 6, 8>>
23 namespace common_installer {
25 std::string EncodeBase64(unsigned char* val, size_t len) {
27 std::copy(base64_encode(val), base64_encode(val + len),
28 std::ostream_iterator<char>(os));
32 } // namespace common_installer