package base58

import "github.com/mr-tron/base58/base58"

Index

Variables

var BTCAlphabet = NewAlphabet("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")

BTCAlphabet is the bitcoin base58 alphabet.

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.

Source Files

alphabet.go base58.go

Version
v1.1.1
Published
Mar 15, 2019
Platform
darwin/amd64
Imports
2 packages
Last checked
7 hours ago

Tools for package owners.