Post
Topic
Board Auctions
Re: [BOUNTY] Mathematica fcns for RIPEMD-160 and base58 coding (0.05 BTC each)
by
CaeZaR
on 20/05/2014, 16:28:45 UTC
Here is the fixed decode:
Code:
Base58Decode[x_String] :=
 FromDigits[
  First[First[
      StringPosition[
        "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", \
#] - 1]] & /@ Characters[x], 58]
You can test these functions with:
Code:
ParallelDo[i = RandomInteger[2^256];
 If[i != Base58Decode[Base58Encode[i]], Print[False]], {100000}]
and
Code:
Table[{i, Base58Encode[i, n -> 5], Base58Decode[Base58Encode[i]]}, {i,
    0, 100}] // TableForm