1 //
2 // Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
3 //
4 // Distributed under the Boost Software License, Version 1.0. (See accompanying
5 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
6 //
7 #pragma once
8 
9 #include "td/utils/common.h"
10 #include "td/utils/SharedSlice.h"
11 #include "td/utils/Slice.h"
12 #include "td/utils/Status.h"
13 
14 namespace td {
15 
16 string base64_encode(Slice input);
17 Result<string> base64_decode(Slice base64);
18 Result<SecureString> base64_decode_secure(Slice base64);
19 
20 string base64url_encode(Slice input);
21 Result<string> base64url_decode(Slice base64);
22 Result<SecureString> base64url_decode_secure(Slice base64);
23 
24 bool is_base64(Slice input);
25 bool is_base64url(Slice input);
26 
27 bool is_base64_characters(Slice input);
28 bool is_base64url_characters(Slice input);
29 
30 string base64_filter(Slice input);
31 
32 string base32_encode(Slice input, bool upper_case = false);
33 Result<string> base32_decode(Slice base32);
34 
35 }  // namespace td
36