It looks like ClickHouse's base58Decode function works incorrectly.

For example, base58-encoded value `1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix` should be decoded to a 32 byte array. Here is an example from python which works correctly:

```
$ python3 -m venv ~/.venv/base58
$ ~/.venv/base58/bin/pip install base58
$ ~/.venv/base58/bin/python3
>>> import base58
>>> base58.b58decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix')
b'\x00\x0b\xe3\xe1\xeb\xa1zG?\x89\xb0\xf7\xe8\xe2I@\xf2\n\xeb\x8e\xbc\xa7\x1a\x88\xfd\xe9]K\x83\xb7\x1a\t'
>>> len(base58.b58decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix'))
32
>>> base58.b58decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix').hex()
'000be3e1eba17a473f89b0f7e8e24940f20aeb8ebca71a88fde95d4b83b71a09'
```

Clickhouse produces incorrect, 31 byte string (notice that the leading NULL byte is missing):

```
:) SELECT length(base58Decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix')) FORMAT Vertical;

Row 1:
──────
length(base58Decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix')): 31

:) select hex(base58Decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix')) format Vertical;

Row 1:
──────
hex(base58Decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix')): 0BE3E1EBA17A473F89B0F7E8E24940F20AEB8EBCA71A88FDE95D4B83B71A09

```

and decode/encode pair does not produce original value:

```
:) SELECT base58Encode(base58Decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix')) FORMAT Vertical;

Row 1:
──────
base58Encode(base58Decode('1BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix')): BWutmTvYPwDtmw9abTkS4Ssr8no61spGAvW1X6NDix
```

**Does it reproduce on recent release?**

Yes. The bug was reproduced on:

```
:) select version() format Vertical;

Row 1:
──────
version(): 22.8.1.2097
```

**How to reproduce**

See above.

**Expected behavior**

* base58Decode should produce correct output
* base58Decode/base58Encode pair should return original value
{
            dst[idx++] = static_cast<unsigned char>(carry % 58);
            carry /= 58;
        }
    }
    size_t c_idx = idx >> 1;
    for (size_t i = 0; i < c_idx; ++i)
    {
        char s = base58_encoding_alphabet[static_cast<unsigned char>(dst[i])];
        dst[i] = base58_encoding_alphabet[static_cast<unsigned char>(dst[idx - (i + 1)])];
        dst[idx - (i + 1)] = s;
    }
    if ((idx & 1))
    {
        dst[c_idx] = base58_encoding_alphabet[static_cast<unsigned char>(dst[c_idx])];
    }
    dst[idx] = '\0';
    return idx + 1;
}
inline size_t decodeBase58(const char8_t * src, char8_t * dst)
{
    const signed char uint_max = UINT_MAX;
    const signed char map_digits[128]
        = {uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max,
           uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max,
           uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max,
           uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, 0,  1,  2,  3,  4,  5,  6,  7,  8,        uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, 9,  10, 11, 12, 13, 14, 15, 16,       uint_max, 17, 18, 19, 20, 21,       uint_max, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32,
           uint_max, uint_max, uint_max, uint_max, uint_max, uint_max, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43,       uint_max, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57,       uint_max, uint_max, uint_max, uint_max, uint_max};
    size_t idx = 0;
    for (; *src; ++src)