fix(base58): basen::Exception
This commit is contained in:
@ -17,34 +17,35 @@ namespace base58
|
||||
bool isValid(std::string_view str) noexcept;
|
||||
|
||||
/**
|
||||
* @throw std::overflow_error if if there is an overflow
|
||||
* @throw basen::Exception(OVERFLOW) if there is an overflow
|
||||
*/
|
||||
size_t sizeEncoded(std::span<const uint8_t> data) noexcept;
|
||||
size_t sizeEncoded(std::span<const uint8_t> data);
|
||||
size_t sizeDecoded(std::string_view str) noexcept;
|
||||
|
||||
/**
|
||||
* @return number of leading chars, which should be trimmed
|
||||
* @warning contain leading zeros, returns count of them
|
||||
*/
|
||||
size_t 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;
|
||||
size_t encode(const uint8_t *data, size_t data_size, char *str, size_t str_size);
|
||||
std::string encode(std::span<const uint8_t> data);
|
||||
|
||||
/**
|
||||
* @return number of leading chars, which should be trimmed
|
||||
* @warning contain leading zeros, returns count of them
|
||||
*/
|
||||
size_t decode(const char *str, size_t str_size, uint8_t *data, size_t data_size) noexcept;
|
||||
std::vector<uint8_t> decode(std::string_view str) noexcept;
|
||||
size_t decode(const char *str, size_t str_size, uint8_t *data, size_t data_size);
|
||||
std::vector<uint8_t> decode(std::string_view str);
|
||||
|
||||
/**
|
||||
* @param data vector or span of data which you want to encode
|
||||
* @return encoded string + 4 first bytes of double sha256
|
||||
*/
|
||||
std::string encodeCheck(std::span<const uint8_t> data) noexcept;
|
||||
std::string encodeCheck(std::span<const uint8_t> data);
|
||||
/**
|
||||
* @param str string or string_view which you want to decode
|
||||
* @return decoded data without 4 first bytes of double sha256
|
||||
* @throw std::logic_error checksum incorrect
|
||||
* @throw basen::Exception(PADDING) if str size < 4
|
||||
* @throw basen::Exception(CHECKSUM) checksum incorrect
|
||||
*/
|
||||
std::vector<uint8_t> decodeCheck(std::string_view str);
|
||||
}
|
||||
@ -14,7 +14,7 @@ namespace base64
|
||||
bool isValid(std::string_view str) noexcept;
|
||||
|
||||
/**
|
||||
* @throw basen::Exception(OVERFLOW) if if there is an overflow
|
||||
* @throw basen::Exception(OVERFLOW) if there is an overflow
|
||||
*/
|
||||
size_t sizeEncoded(std::span<const uint8_t> data);
|
||||
size_t sizeDecoded(std::string_view str) noexcept;
|
||||
|
||||
@ -14,7 +14,7 @@ namespace hex
|
||||
bool isValid(std::string_view str) noexcept;
|
||||
|
||||
/**
|
||||
* @throw basen::Exception(OVERFLOW) if if there is an overflow
|
||||
* @throw basen::Exception(OVERFLOW) if there is an overflow
|
||||
*/
|
||||
size_t sizeEncoded(std::span<const uint8_t> data);
|
||||
size_t sizeDecoded(std::string_view str) noexcept;
|
||||
|
||||
Reference in New Issue
Block a user