Crate fd_bs58

source ·
Expand description

An optimized implementation of Base58 encoding/decoding for 32 and 64 byte numbers. This library is based off of the original C implementation from Jump Crypto’s Firedancer repo which can be found here. These algorithms are significantly faster than the commonly used bs58 library for 32 and 64 bytes.

Performance vs. bs58

AlgorithmSpeedup
encode_32~9x
encode_64~13x
decode_32~3x
decode_64~5x

Modules

Enums

Functions

  • Decodes the given base58 string into 32 bytes using an optimized decoding algorithm. This function will return an error if the string is not base58 encoded or the result is not 32 bytes.
  • Decodes the given base58 string into 64 bytes using an optimized decoding algorithm. This function will return an error if the string is not base58 encoded or the result is not 64 bytes.
  • Encodes the given 32 bytes using an optimized base58 encoding algorithm.
  • Encodes the given 64 bytes using an optimized base58 encoding algorithm.