The Battle for Wesnoth  1.15.2+dev
base64.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2003 - 2018 by David White <dave@whitevine.net>
3  Part of the Battle for Wesnoth Project https://www.wesnoth.org/
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #pragma once
16 
18 
19 #include <vector>
20 
21 // Official Base64 encoding (RFC4648)
22 namespace base64 {
23  std::vector<uint8_t> decode(utils::string_view encoded);
24  std::string encode(utils::byte_string_view bytes);
25 }
26 // crypt()-compatible radix-64 encoding
27 namespace crypt64 {
28  std::vector<uint8_t> decode(utils::string_view encoded);
29  std::string encode(utils::byte_string_view bytes);
30  // Single character functions. For special use only
31  int decode(char encoded_char);
32  char encode(int value);
33 }
std::string encode(utils::byte_string_view bytes)
Definition: base64.cpp:219
std::vector< uint8_t > decode(utils::string_view in)
Definition: base64.cpp:215