xrpld
Loading...
Searching...
No Matches
include
xrpl
basics
base64.h
1
// Distributed under the Boost Software License, Version 1.0. (See accompanying
2
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
3
//
4
5
/*
6
Portions from http://www.adp-gmbh.ch/cpp/common/base64.html
7
Copyright notice:
8
9
base64.cpp and base64.h
10
11
Copyright (C) 2004-2008 René Nyffenegger
12
13
This source code is provided 'as-is', without any express or implied
14
warranty. In no event will the author be held liable for any damages
15
arising from the use of this software.
16
17
Permission is granted to anyone to use this software for any purpose,
18
including commercial applications, and to alter it and redistribute it
19
freely, subject to the following restrictions:
20
21
1. The origin of this source code must not be misrepresented; you must not
22
claim that you wrote the original source code. If you use this source code
23
in a product, an acknowledgment in the product documentation would be
24
appreciated but is not required.
25
26
2. Altered source versions must be plainly marked as such, and must not be
27
misrepresented as being the original source code.
28
29
3. This notice may not be removed or altered from any source distribution.
30
31
René Nyffenegger rene.nyffenegger@adp-gmbh.ch
32
33
*/
34
35
#pragma once
36
37
#include <
cstdint
>
38
#include <
string
>
39
#include <
string_view
>
40
41
namespace
xrpl
{
42
43
std::string
44
base64Encode
(std::uint8_t
const
* data, std::size_t len);
45
46
inline
std::string
47
base64Encode
(
std::string_view
s)
48
{
49
return
base64Encode
(
reinterpret_cast<
std::uint8_t
const*
>
(s.
data
()), s.
size
());
50
}
51
52
std::string
53
base64Decode
(
std::string_view
data);
54
55
}
// namespace xrpl
std::string
std::string_view
cstdint
std::string_view::data
T data(T... args)
std::uint8_t
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::base64Decode
std::string base64Decode(std::string_view data)
Definition
libxrpl/basics/base64.cpp:211
xrpl::base64Encode
std::string base64Encode(std::uint8_t const *data, std::size_t len)
Definition
libxrpl/basics/base64.cpp:202
std::string_view::size
T size(T... args)
string
string_view
Generated by
1.16.1