Documentation
¶
Index ¶
- Variables
- func Decode(str string) ([]byte, error)
- func DecodeAlphabet(str string, alphabet *Alphabet) ([]byte, error)
- func Encode(bin []byte) string
- func EncodeAlphabet(bin []byte, alphabet *Alphabet) string
- func FastBase58Decoding(str string) ([]byte, error)
- func FastBase58DecodingAlphabet(str string, alphabet *Alphabet) ([]byte, error)
- func FastBase58Encoding(bin []byte) string
- func FastBase58EncodingAlphabet(bin []byte, alphabet *Alphabet) string
- type Alphabet
Constants ¶
This section is empty.
Variables ¶
var BitcoinAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
BTCAlphabet is the bitcoin base58 alphabet.
var FlickrAlphabet = NewAlphabet("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ")
FlickrAlphabet is the flickr base58 alphabet.
var MoneroAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
var RippleAlphabet = NewAlphabet("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz")
Functions ¶
func DecodeAlphabet ¶
DecodeAlphabet decodes the base58 encoded bytes using the given b58 alphabet.
func EncodeAlphabet ¶
EncodeAlphabet encodes the passed bytes into a base58 encoded string with the passed alphabet.
func FastBase58Decoding ¶
FastBase58Decoding decodes the base58 encoded bytes.
func FastBase58DecodingAlphabet ¶
FastBase58DecodingAlphabet decodes the base58 encoded bytes using the given b58 alphabet.
func FastBase58Encoding ¶
FastBase58Encoding encodes the passed bytes into a base58 encoded string.
func FastBase58EncodingAlphabet ¶
FastBase58EncodingAlphabet encodes the passed bytes into a base58 encoded string with the passed alphabet.
Types ¶
type Alphabet ¶
type Alphabet struct {
// contains filtered or unexported fields
}
Alphabet is a a b58 alphabet.
func NewAlphabet ¶
NewAlphabet creates a new alphabet from the passed string.
It panics if the passed string is not 58 bytes long, isn't valid ASCII, or does not contain 58 distinct characters.