lbcutil/base58
Josh Bleecher Snyder a53e38424c base58: allocate less in Encode
* calculate maximum output length more precisely
  to avoid allocation in the append
* use big.Int.Sign instead of needing bigZero

name                 old time/op    new time/op    delta
Base58Encode_5K-8      5.86ms ± 3%    5.79ms ± 2%   -1.27%  (p=0.035 n=9+10)
Base58Encode_100K-8     2.23s ± 1%     2.23s ± 0%     ~     (p=0.074 n=9+8)
Base58Decode_5K-8       281µs ± 1%     282µs ± 1%     ~     (p=0.720 n=9+10)
Base58Decode_100K-8    89.4ms ± 7%    88.3ms ± 7%     ~     (p=0.123 n=10+10)

name                 old speed      new speed      delta
Base58Encode_5K-8     854kB/s ± 3%   864kB/s ± 2%     ~     (p=0.134 n=9+10)
Base58Encode_100K-8  40.0kB/s ± 0%  40.0kB/s ± 0%     ~     (all equal)
Base58Decode_5K-8    24.3MB/s ± 1%  24.2MB/s ± 1%     ~     (p=0.644 n=9+10)
Base58Decode_100K-8  1.53MB/s ± 7%  1.55MB/s ± 7%     ~     (p=0.218 n=10+10)

name                 old alloc/op   new alloc/op   delta
Base58Encode_5K-8      28.7kB ± 0%    19.2kB ± 0%  -33.03%  (p=0.000 n=10+10)
Base58Encode_100K-8     557kB ± 0%     385kB ± 0%  -30.88%  (p=0.000 n=10+10)
Base58Decode_5K-8       349kB ± 0%     349kB ± 0%     ~     (all equal)
Base58Decode_100K-8     133MB ± 0%     133MB ± 0%     ~     (p=0.183 n=10+10)

name                 old allocs/op  new allocs/op  delta
Base58Encode_5K-8        5.00 ± 0%      4.00 ± 0%  -20.00%  (p=0.000 n=10+10)
Base58Encode_100K-8      5.00 ± 0%      4.00 ± 0%  -20.00%  (p=0.000 n=10+10)
Base58Decode_5K-8         129 ± 0%       129 ± 0%     ~     (all equal)
Base58Decode_100K-8     2.51k ± 0%     2.51k ± 0%     ~     (p=0.321 n=10+10)

When Go 1.16 is released, performance will improve
significantly due to improvements to math/big.Int's division implementation.
2020-12-08 09:37:02 -05:00
..
alphabet.go Relicense to the btcsuite developers. 2015-05-01 12:41:58 -05:00
base58.go base58: allocate less in Encode 2020-12-08 09:37:02 -05:00
base58_test.go base58: add new testcases from github.com/bitcoin 2020-11-24 13:21:44 -05:00
base58bench_test.go base58: optimize Encode 2020-11-24 13:21:44 -05:00
base58check.go Relicense to the btcsuite developers. 2015-05-01 12:41:58 -05:00
base58check_test.go Fix error in base58check test 2020-07-13 09:35:42 -04:00
cov_report.sh Create a new sub-package base58. 2014-12-22 11:43:07 +01:00
doc.go Relicense to the btcsuite developers. 2015-05-01 12:41:58 -05:00
example_test.go Relicense to the btcsuite developers. 2015-05-01 12:41:58 -05:00
genalphabet.go Relicense to the btcsuite developers. 2015-05-01 12:41:58 -05:00
README.md multi: Update markdown files for GFM changes. 2017-05-25 13:01:10 -05:00

base58

Build Status ISC License GoDoc

Package base58 provides an API for encoding and decoding to and from the modified base58 encoding. It also provides an API to do Base58Check encoding, as described here.

A comprehensive suite of tests is provided to ensure proper functionality.

Installation and Updating

$ go get -u github.com/btcsuite/btcutil/base58

Examples

License

Package base58 is licensed under the copyfree ISC License.