base58

package
v0.0.0-...-485d38d Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2017 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var BitcoinEncoding = NewEncoding(encodeBitcoin)

BitcoinEncoding is the base58 encoding used in the Bitcoin protocol

View Source
var FlickrEncoding = NewEncoding(encodeFlickr)

FlickrEncoding is the base58 encoding used in Flickr short urls.

Functions

This section is empty.

Types

type CorruptDecodeInputError

type CorruptDecodeInputError byte

func (CorruptDecodeInputError) Error

func (e CorruptDecodeInputError) Error() string

type CorruptEncodeInputError

type CorruptEncodeInputError big.Int

func (CorruptEncodeInputError) Error

func (e CorruptEncodeInputError) Error() string

type Encoding

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

An Encoding is a radix 58 encoding/decoding scheme, defined by a 58 character alphabet.

func NewEncoding

func NewEncoding(encoder string) *Encoding

NewEncoding returns a new Encoding defined by the given alphabet, which must be a 58-byte string.

func (*Encoding) Decode

func (enc *Encoding) Decode(src []byte) ([]byte, error)

func (*Encoding) DecodeFromString

func (enc *Encoding) DecodeFromString(src string) ([]byte, error)

func (*Encoding) DecodeToInt

func (enc *Encoding) DecodeToInt(src []byte) (*big.Int, error)

func (*Encoding) Encode

func (enc *Encoding) Encode(src []byte) ([]byte, error)

Encode encodes src using the encoding enc. Leading 0 bytes in the src are encoded as 0 bytes in the encoded alphabet. The ensure that leading 0 bytes are not lost during encoding.

func (*Encoding) EncodeInt

func (enc *Encoding) EncodeInt(src *big.Int) ([]byte, error)

Encode encodes src using the encoding enc. src must be positive

func (*Encoding) EncodeToString

func (enc *Encoding) EncodeToString(src []byte) (string, error)

Encode encodes src using the encoding enc. Leading 0 bytes in the src are encoded as 0 bytes in the encoded alphabet. The ensure that leading 0 bytes are not lost during encoding.

Jump to

Keyboard shortcuts

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