libkazv
base64.hpp
Go to the documentation of this file.
1 /*
2  * This file is part of libkazv.
3  * SPDX-FileCopyrightText: 2020-2021 Tusooa Zhu <tusooa@kazv.moe>
4  * SPDX-License-Identifier: AGPL-3.0-or-later
5  */
6 
7 #pragma once
8 #include <libkazv-config.hpp>
9 
10 namespace Kazv
11 {
12  namespace Base64Opts
13  {
17  enum Base64Opts : int
18  {
19  none = 0x0,
20  urlSafe = 0x1,
21  padded = 0x2,
22  };
23  }
30  std::string encodeBase64(std::string original, int flags = Base64Opts::none);
31 
38  std::string decodeBase64(std::string encoded, int flags = Base64Opts::none);
39 }
Base64Opts
Bit flags for encodeBase64 and decodeBase64.
Definition: base64.hpp:18
@ padded
Url-safe.
Definition: base64.hpp:21
@ none
Definition: base64.hpp:19
@ urlSafe
The default, not url-safe, unpadded.
Definition: base64.hpp:20
Definition: location.hpp:10
std::string encodeBase64(std::string original, int flags)
Encodes the original string to base64.
Definition: base64.cpp:15
std::string decodeBase64(std::string encoded, int flags)
Decode base64 string.
Definition: base64.cpp:48