Documentation ¶
Index ¶
- Variables
- type CorruptDecodeInputError
- type CorruptEncodeInputError
- type Encoding
- func (enc *Encoding) Decode(src []byte) ([]byte, error)
- func (enc *Encoding) DecodeFromString(src string) ([]byte, error)
- func (enc *Encoding) DecodeToInt(src []byte) (*big.Int, error)
- func (enc *Encoding) Encode(src []byte) ([]byte, error)
- func (enc *Encoding) EncodeInt(src *big.Int) ([]byte, error)
- func (enc *Encoding) EncodeToString(src []byte) (string, error)
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 ¶
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 ¶
NewEncoding returns a new Encoding defined by the given alphabet, which must be a 58-byte string.
func (*Encoding) DecodeFromString ¶
func (*Encoding) Encode ¶
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.
Click to show internal directories.
Click to hide internal directories.