base58

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package base58 implementation ported from : https://github.com/mr-tron/base58

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decode

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

Decode decodes the base58 encoded bytes.

func DecodeAlphabet

func DecodeAlphabet(str string, alphabet *Alphabet) ([]byte, error)

DecodeAlphabet decodes the base58 encoded bytes using the given b58 alphabet.

func Decoding

func Decoding(str string) ([]byte, error)

Decoding decodes the base58 encoded bytes.

func DecodingAlphabet

func DecodingAlphabet(str string, alphabet *Alphabet) ([]byte, error)

DecodingAlphabet decodes the base58 encoded bytes using the given b58 alphabet.

func Encode

func Encode(bin []byte) (string, error)

Encode encodes the passed bytes into a base58 encoded string.

func EncodeAlphabet

func EncodeAlphabet(bin []byte, alphabet *Alphabet) string

EncodeAlphabet encodes the passed bytes into a base58 encoded string with the passed alphabet.

func Encoding

func Encoding(bin []byte) (string, error)

Encoding encodes the passed bytes into a base58 encoded string.

func EncodingAlphabet

func EncodingAlphabet(bin []byte, alphabet *Alphabet) string

EncodingAlphabet encodes the passed bytes into a base58 encoded string with the passed alphabet.

Types

type Alphabet

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

Alphabet is a a b58 alphabet.

func NewAlphabet

func NewAlphabet(s string) (*Alphabet, error)

NewAlphabet creates a new alphabet from the passed string.

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

Jump to

Keyboard shortcuts

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