unify with snowcone
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user