Maze Builder Docs 8.2.1
Loading...
Searching...
No Matches
bytes.h
Go to the documentation of this file.
1#ifndef BYTES_H
2#define BYTES_H
3
4#include <cstdint>
5#include <string>
6#include <string_view>
7#include <vector>
8
11namespace mazes
12{
16 class bytes
17 {
18 public:
22 static std::string encode(std::string_view sv) noexcept;
23
27 static std::string decode(std::string_view sv) noexcept;
28
32 static std::string_view bytes_to_string(const std::vector<std::uint8_t>& bytes) noexcept;
33
37 static std::vector<std::uint8_t> string_to_bytes(std::string_view sv) noexcept;
38
42 static std::string to_base36(std::uint32_t value) noexcept;
43 }; // class
44} // namespace
45
46#endif // BYTES_H
Base64 encoding and decoding helper class.
Definition bytes.h:17
static std::string encode(std::string_view sv) noexcept
Transform an input string into base64 characters.
static std::string decode(std::string_view sv) noexcept
Transform an input string from from base64 characters.
static std::string_view bytes_to_string(const std::vector< std::uint8_t > &bytes) noexcept
Transform a vector of bytes into a string_view.
static std::vector< std::uint8_t > string_to_bytes(std::string_view sv) noexcept
Transform a string_view into a vector of bytes.
static std::string to_base36(std::uint32_t value) noexcept
Convert an 32-bit integer value to a base36 string.