base58

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 2 Imported by: 5

README

GoDoc

Modified implementation based on github.com/mr-tron/base58 itself based on https://github.com/trezor/trezor-crypto/blob/master/base58.c

It's nice to have a fast base58 implementation but do we really need to have the slow version in the same lib too?

Usage

// to decode some base58 string
dec, err := base58.Bitcoin.Decode(in)
if err != nil {
    // handle err
}
// or, to encode:
enc := base58.Bitcoin.Encode(dec)

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Bitcoin = NewEncoding("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")
	Flickr  = NewEncoding("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ")
)

Functions

This section is empty.

Types

type Encoding

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

func NewEncoding

func NewEncoding(s string) *Encoding

NewEncoding returns a encoding structure initialized for decoding/encoding using the passed parameter

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

func (*Encoding) Decode

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

func (*Encoding) Encode

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

Jump to

Keyboard shortcuts

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