feat(base64): isValid
This commit is contained in:
18
include/base/base64.hpp
Normal file
18
include/base/base64.hpp
Normal file
@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <span>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace base64
|
||||
{
|
||||
bool isValid(const char *str) noexcept;
|
||||
bool isValid(std::string_view str) noexcept;
|
||||
|
||||
void encode(const uint8_t *data, uint64_t data_size, char *str) noexcept;
|
||||
std::string encode(std::span<const uint8_t> data) noexcept;
|
||||
|
||||
void decode(const char *str, uint8_t *data, uint64_t data_size);
|
||||
std::vector<uint8_t> decode(std::string_view str);
|
||||
}
|
||||
@ -9,8 +9,10 @@ namespace hex
|
||||
{
|
||||
bool isValid(const char *str) noexcept;
|
||||
bool isValid(std::string_view str) noexcept;
|
||||
|
||||
void encode(const uint8_t *data, size_t data_size, char *str, size_t str_size) noexcept;
|
||||
std::string encode(std::span<const uint8_t> data) noexcept;
|
||||
|
||||
void decode(const char *str, size_t str_size, uint8_t *data, size_t data_size);
|
||||
std::vector<uint8_t> decode(std::string_view str);
|
||||
}
|
||||
@ -1,3 +1,4 @@
|
||||
#include <base/hex.hpp>
|
||||
#include <base/baseN.hpp>
|
||||
#include <base/base64.hpp>
|
||||
#include <base/hash/sha256.hpp>
|
||||
Reference in New Issue
Block a user