feat(base58): unfixed bug with double \0 and incorrect real str_size

This commit is contained in:
2024-09-19 01:50:32 +03:00
parent f2119850ee
commit 817f6c4fb1
8 changed files with 172 additions and 61 deletions

View File

@ -11,8 +11,7 @@ namespace baseN
{
bool isValid(const char *str, uint64_t str_size, const int8_t *map) noexcept
{
std::string_view sv(str, str_size);
return std::all_of(sv.begin(), sv.end(), [map](char ch)
return std::all_of(str, str + str_size, [map](char ch)
{ return map[(int8_t)ch] != -1; });
}
bool isValid(std::string_view str, const int8_t *map) noexcept