unify with snowcone

This commit is contained in:
2025-02-05 09:24:47 -08:00
parent 5f2439e5af
commit 2b4bb1f071
20 changed files with 589 additions and 483 deletions

View File

@@ -2,15 +2,14 @@
* @file mybase64.hpp
* @author Eric Mertens (emertens@gmail.com)
* @brief Base64 encoding and decoding
*
*
*/
#pragma once
#include <cstddef>
#include <string_view>
namespace mybase64
{
namespace mybase64 {
inline constexpr auto encoded_size(std::size_t len) -> std::size_t
{
@@ -24,7 +23,7 @@ inline constexpr auto decoded_size(std::size_t len) -> std::size_t
/**
* @brief Encode a string into base64
*
*
* @param input input text
* @param output Target buffer for encoded value
*/
@@ -32,13 +31,11 @@ auto encode(std::string_view input, char* output) -> void;
/**
* @brief Decode a base64 encoded string
*
*
* @param input Base64 input text
* @param output Target buffer for decoded value
* @param outlen Output parameter for decoded length
* @return true success
* @return false failure
* @return pointer to end of output on success
*/
auto decode(std::string_view input, char* output, std::size_t* outlen) -> bool;
auto decode(std::string_view input, char* output) -> char*;
} // namespace