rippled
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
#ifndef XRPL_BASICS_BASE64_H_INCLUDED
36
#define XRPL_BASICS_BASE64_H_INCLUDED
37
38
#include <
cstdint
>
39
#include <
string
>
40
41
namespace
ripple
{
42
43
std::string
44
base64_encode
(
std::uint8_t
const
* data,
std::size_t
len);
45
46
inline
std::string
47
base64_encode
(
std::string
const
& s)
48
{
49
return
base64_encode
(
50
reinterpret_cast<
std::uint8_t
const*
>
(s.
data
()), s.
size
());
51
}
52
53
std::string
54
base64_decode
(
std::string_view
data);
55
56
}
// namespace ripple
57
58
#endif
std::string
std::string_view
cstdint
std::string::data
T data(T... args)
std::uint8_t
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
ripple::base64_decode
std::string base64_decode(std::string_view data)
Definition
libxrpl/basics/base64.cpp:226
ripple::base64_encode
std::string base64_encode(std::uint8_t const *data, std::size_t len)
Definition
libxrpl/basics/base64.cpp:217
std::string::size
T size(T... args)
std::size_t
string
Generated by
1.9.8