Some checks failed
Linux Build / Linux cpu (push) Has been cancelled
Linux Build / Linux cpu-clang (push) Has been cancelled
Linux Build / Linux vulkan (push) Has been cancelled
mac-build / macOS CPU (push) Has been cancelled
Nix Build / Nix (cpu) (push) Has been cancelled
Nix Build / Nix (vulkan) (push) Has been cancelled
windows-build / Windows CPU (push) Has been cancelled
21 lines
717 B
C++
21 lines
717 B
C++
#pragma once
|
|
|
|
#include <cstddef>
|
|
#include <cstdint>
|
|
#include <string>
|
|
#include <string_view>
|
|
#include <vector>
|
|
|
|
namespace minitts::app {
|
|
|
|
std::string base64_encode(const uint8_t * data, size_t size);
|
|
std::string base64_encode(const std::vector<uint8_t> & bytes);
|
|
std::string base64_encode(const std::vector<std::byte> & bytes);
|
|
|
|
// Decodes a base64 payload. Accepts an optional "data:<mime>;base64," prefix so
|
|
// clients can send data URIs verbatim. Throws std::runtime_error on malformed input.
|
|
std::vector<uint8_t> base64_decode(std::string_view input);
|
|
// The same, as std::byte, for payloads that are kept as such.
|
|
std::vector<std::byte> base64_decode_bytes(std::string_view input);
|
|
|
|
} // namespace minitts::app
|