multibase

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Identity          = 0x00
	Base1             = '1'
	Base2             = '0'
	Base8             = '7'
	Base10            = '9'
	Base16            = 'f'
	Base16Upper       = 'F'
	Base32            = 'b'
	Base32Upper       = 'B'
	Base32pad         = 'c'
	Base32padUpper    = 'C'
	Base32hex         = 'v'
	Base32hexUpper    = 'V'
	Base32hexPad      = 't'
	Base32hexPadUpper = 'T'
	Base58Flickr      = 'Z'
	Base58BTC         = 'z'
	Base64            = 'm'
	Base64url         = 'u'
	Base64pad         = 'M'
	Base64urlPad      = 'U'
)

These are the supported encodings

Variables

View Source
var ErrUnsupportedEncoding = fmt.Errorf("selected encoding not supported")

ErrUnsupportedEncoding is returned when the selected encoding is not known or implemented.

Functions

func Encode

func Encode(base Encoding, data []byte) (string, error)

Encode encodes a given byte slice with the selected encoding and returns a multibase string (<encoding><base-encoded-string>). It will return an error if the selected base is not known.

Types

type Encoding

type Encoding int

Encoding identifies the type of base-encoding that a multibase is carrying.

func Decode

func Decode(data string) (Encoding, []byte, error)

Decode takes a multibase string and decodes into a bytes buffer. It will return an error if the selected base is not known.

Jump to

Keyboard shortcuts

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