base58

package
v1.5.1 Latest Latest
Warning

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

Go to latest
Published: May 18, 2025 License: BSD-2-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IBase uint32 = 256
	OBase uint32 = 58
)

Variables

View Source
var (
	EncodeTransformer = basebb.MustNewTransformer(IBase, OBase)
	DecodeTransformer = basebb.MustNewTransformer(OBase, IBase)

	BitcoinEncoding = MustNewEncoding("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
	FlickrEncoding  = MustNewEncoding("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ")
)

Functions

func Decode

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

func Encode

func Encode(in []byte) string

Types

type Encoding

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

func MustNewEncoding

func MustNewEncoding(alphabet string) *Encoding

func NewEncoding

func NewEncoding(alphabet string) (*Encoding, error)

func (*Encoding) Decode

func (e *Encoding) Decode(_in string) ([]byte, error)

func (*Encoding) Encode

func (e *Encoding) Encode(in []byte) string

type InvalidAlphabetError

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

func (InvalidAlphabetError) Error

func (e InvalidAlphabetError) Error() string

type InvalidCharError

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

func (InvalidCharError) Error

func (e InvalidCharError) Error() string

Jump to

Keyboard shortcuts

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