From 5b76028d8a7017660ebc982bdc046a4629ec4fe7 Mon Sep 17 00:00:00 2001 From: SEK1RO Date: Sun, 22 Sep 2024 21:50:49 +0300 Subject: [PATCH] feat(docs): hex.hpp --- include/basen/hex.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/include/basen/hex.hpp b/include/basen/hex.hpp index ce4bc26..5280dce 100644 --- a/include/basen/hex.hpp +++ b/include/basen/hex.hpp @@ -13,12 +13,23 @@ namespace hex 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 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 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 str_size %2 != 0 (isn't hex) + */ void decode(const char *str, uint64_t str_size, uint8_t *data, uint64_t data_size); std::vector decode(std::string_view str) noexcept; } \ No newline at end of file