Enigma  3.2.0
A Simple, Reliable and Efficient Encryption Tool
Base64.hpp
Go to the documentation of this file.
1 #pragma once
2 #ifndef ENIGMA_BASE64_H
3 #define ENIGMA_BASE64_H
4 
5 #include <Core/Core.hpp>
6 
8 class Base64 final {
9  ENIGMA_STATIC_CLASS(Base64);
10 
11  public:
12  /*
13  * Encodes string bytes into Base64 string
14  * https://www.cryptopp.com/wiki/Base64Encoder
15  */
16  static std::vector<byte> Encode(const std::vector<byte>& buffer);
17  static std::vector<byte> Encode(const byte *buffer, const std::size_t buffLen);
18  static std::string Encode(const std::string& buffer);
19 
20  /*
21  * Decodes a Base64 string
22  * https://www.cryptopp.com/wiki/Base64Decoder
23  */
24  static std::vector<byte> Decode(const std::vector<byte>& encoded_buffer);
25  static std::vector<byte> Decode(const byte *buffer, const std::size_t buffLen);
26  static std::string Decode(const std::string& encoded);
27 };
29 
30 #endif // !ENIGMA_BASE64_H
#define NS_ENIGMA_BEGIN
Enable/Disable Assertions.
Definition: Macros.hpp:13
#define NS_ENIGMA_END
Definition: Macros.hpp:14
Definition: Base64.hpp:8
static std::vector< byte > Encode(const std::vector< byte > &buffer)
static std::string Encode(const std::string &buffer)
static std::vector< byte > Encode(const byte *buffer, const std::size_t buffLen)
static std::vector< byte > Decode(const byte *buffer, const std::size_t buffLen)
static std::vector< byte > Decode(const std::vector< byte > &encoded_buffer)
static std::string Decode(const std::string &encoded)