feat(docs): base64.hpp
This commit is contained in:
@ -13,12 +13,23 @@ namespace base64
|
||||
bool isValid(const char *str, uint64_t str_size) noexcept;
|
||||
bool isValid(std::string_view str) noexcept;
|
||||
|
||||
/**
|
||||
* @throw std::overflow_error if if there is an overflow
|
||||
*/
|
||||
uint64_t sizeEncoded(std::span<const uint8_t> data);
|
||||
uint64_t sizeDecoded(std::string_view str) noexcept;
|
||||
|
||||
/**
|
||||
* @throw std::length_error if not enough allocated length
|
||||
*/
|
||||
void encode(const uint8_t *data, uint64_t data_size, char *str, uint64_t str_size);
|
||||
std::string encode(std::span<const uint8_t> data) noexcept;
|
||||
|
||||
/**
|
||||
* @throw std::length_error if not enough allocated length
|
||||
* @throw std::logic_error if out of digits map
|
||||
* @throw std::logic_error if incorrect padding
|
||||
*/
|
||||
void decode(const char *str, uint64_t str_size, uint8_t *data, uint64_t data_size);
|
||||
std::vector<uint8_t> decode(std::string_view str) noexcept;
|
||||
}
|
||||
@ -32,6 +32,7 @@ namespace baseN
|
||||
* @param base from 1 to 255
|
||||
* @param digits char[base] array of digits
|
||||
* @return estimated size after decoding
|
||||
* @throw std::overflow_error if if there is an overflow
|
||||
*/
|
||||
uint64_t sizeDecoded(std::string_view str, uint8_t base, const char *digits) noexcept;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user