On 08/08/2025 03:11, Collin Funk wrote:
Hi Pádraig,

Pádraig Brady <p...@draigbrady.com> writes:

A 58 character encoding that:
  - avoids visually ambiguous 0OIl characters
  - uses only alphanumeric characters
Described at:
  - https://tools.ietf.org/html/draft-msporny-base58-03

This implementation uses GMP (or gnulib's gmp fallback).
Performance is good in comparison to other implementations.
For example when using libgmp, encoding is 6 times faster,
and decoding 28 times faster than the implementation
using arbitrary precision ints in cypthon 3.13.

Interesting, is this encoding used anywhere outside of bitcoin?

Just curious, the encoding seems interesting regardless.

Yes it originated from bitcoin use,
though there are various uses in IPFS, URL IDs, etc.
It's widely available in library form, suggesting its general usefulness.
It's also a good practical case to generalize the basenc code,
and I thought it neatly leveraged the existing gmp functionality.

+static void
+base58_encode (char const* data, size_t data_len,
+               char *out, idx_t *outlen)
+{
+    affirm (base_length (data_len) <= *outlen);

Did you mean to use 4 spaces for indentation here?Hah, good spot. Fixed locally.

cheers,
Padraig

Reply via email to