base58

package
v1.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2021 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BTCAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")

BTCAlphabet is the bitcoin base58 alphabet.

View Source
var FlickrAlphabet = NewAlphabet("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ")

FlickrAlphabet is the flickr base58 alphabet.

Functions

func Decode

func Decode(str string) ([]byte, error)

Decode decodes the base58 encoded bytes.

func DecodeAlphabet

func DecodeAlphabet(str string, alphabet *Alphabet) ([]byte, error)

DecodeAlphabet decodes the base58 encoded bytes using the given b58 alphabet.

func Encode

func Encode(bin []byte) string

Encode encodes the passed bytes into a base58 encoded string.

func EncodeAlphabet

func EncodeAlphabet(bin []byte, alphabet *Alphabet) string

EncodeAlphabet encodes the passed bytes into a base58 encoded string with the passed alphabet.

func FastBase58Decoding

func FastBase58Decoding(str string) ([]byte, error)

FastBase58Decoding decodes the base58 encoded bytes.

func FastBase58DecodingAlphabet

func FastBase58DecodingAlphabet(str string, alphabet *Alphabet) ([]byte, error)

FastBase58DecodingAlphabet decodes the base58 encoded bytes using the given b58 alphabet.

func FastBase58Encoding

func FastBase58Encoding(bin []byte) string

FastBase58Encoding encodes the passed bytes into a base58 encoded string.

func FastBase58EncodingAlphabet

func FastBase58EncodingAlphabet(bin []byte, alphabet *Alphabet) string

FastBase58EncodingAlphabet encodes the passed bytes into a base58 encoded string with the passed alphabet.

func TrivialBase58Decoding

func TrivialBase58Decoding(str string) ([]byte, error)

TrivialBase58Decoding decodes the base58 encoded bytes (inefficiently).

func TrivialBase58DecodingAlphabet

func TrivialBase58DecodingAlphabet(str string, alphabet *Alphabet) ([]byte, error)

TrivialBase58DecodingAlphabet decodes the base58 encoded bytes (inefficiently) using the given b58 alphabet.

func TrivialBase58Encoding

func TrivialBase58Encoding(a []byte) string

TrivialBase58Encoding encodes the passed bytes into a base58 encoded string (inefficiently).

func TrivialBase58EncodingAlphabet

func TrivialBase58EncodingAlphabet(a []byte, alphabet *Alphabet) string

TrivialBase58EncodingAlphabet encodes the passed bytes into a base58 encoded string (inefficiently) with the passed alphabet.

Types

type Alphabet

type Alphabet struct {
	// contains filtered or unexported fields
}

Alphabet is a a b58 alphabet.

func NewAlphabet

func NewAlphabet(s string) *Alphabet

NewAlphabet creates a new alphabet from the passed string.

It panics if the passed string is not 58 bytes long or isn't valid ASCII.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL