Pádraig Brady <[email protected]> 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