coreutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH V2] basenc: add base58 support


From: Collin Funk
Subject: Re: [PATCH V2] basenc: add base58 support
Date: Sat, 09 Aug 2025 12:10:11 -0700
User-agent: Gnus/5.13 (Gnus v5.13)

PƔdraig Brady <P@draigBrady.com> writes:

> So the method proposed above seems to work well.
> After adjusting base58_encode() to use mpz_import()+mpz_get_str(),
> and base58_decode() to use mpz_set_str()+mpz_export(),
> encoding is now 530 times faster, and decoding 830 times faster
> than the implementation using arbitrary precision ints in cpython 3.13.

Looks good, thanks! One day I will find the time to better understand
the gmp functions...

> Also the prelim patch had a typo in a single char in the gmp_to_base58 map,
> where I typed ..yuv.. rather than ..tuv.. (due to me writing lots
> of yuv video processing code years ago :))
> The test suite didn't actually pick that up, so I updated the test
> so that all possible encoded chars are tested.

Thanks! The other test from the RFC might be nice to add:

    The Base58 encoded value for "The quick brown fox jumps over the
    lazy dog." is:

    USm3fpXnKG5EUBx2ndxBDMPVciP5hGey2Jh4NDv6gmeo1LkMeiKrLJUUBk6Z

But we would still need $base58_all_chars regardless.

Collin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]