feat(docs): base64.hpp
This commit is contained in:
@ -64,7 +64,7 @@ namespace base64
|
||||
{
|
||||
if (str_size < base64::sizeEncoded(std::span<const uint8_t>(data, data_size)))
|
||||
{
|
||||
throw std::logic_error("base64::encode: not enough allocated length");
|
||||
throw std::length_error("base64::encode: not enough allocated length");
|
||||
}
|
||||
for (uint64_t i = 0; i < data_size / 3; i++)
|
||||
{
|
||||
@ -106,7 +106,7 @@ namespace base64
|
||||
std::string_view sv(str, str_size);
|
||||
if (data_size < base64::sizeDecoded(sv))
|
||||
{
|
||||
throw std::logic_error("base64::decode: not enough allocated length");
|
||||
throw std::length_error("base64::decode: not enough allocated length");
|
||||
}
|
||||
if (!base64::isValid(sv))
|
||||
{
|
||||
|
||||
@ -50,7 +50,7 @@ namespace hex
|
||||
{
|
||||
if (str_size < hex::sizeEncoded(std::span<const uint8_t>(data, data_size)))
|
||||
{
|
||||
throw std::logic_error("hex::encode: not enough allocated length");
|
||||
throw std::length_error("hex::encode: not enough allocated length");
|
||||
}
|
||||
for (uint64_t i = 0; i < data_size; i++)
|
||||
{
|
||||
@ -72,7 +72,7 @@ namespace hex
|
||||
}
|
||||
if (data_size < hex::sizeDecoded(std::string_view(str, str_size)))
|
||||
{
|
||||
throw std::logic_error("hex::decode: not enough allocated length");
|
||||
throw std::length_error("hex::decode: not enough allocated length");
|
||||
}
|
||||
if (!hex::isValid(str, str_size))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user