encoding

package
v0.0.0-...-61197bd Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorInvalidBase58String = errors.New("invalid base58 string")
)

Errors

View Source
var (
	//井通字母表
	JingTumAlphabet = NewAlphabet("jpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65rkm8oFqi1tuvAxyz")
)

Functions

func Base58Decode

func Base58Decode(input string, alphabet *Alphabet) ([]byte, error)

*

  • 以传入的字母表对输入值进行base58解码。
  • params:
  • input:待解码字符串
  • alphabet:base58编码字母表
  • return:
  • []byte, error

func Base58Encode

func Base58Encode(input []byte, alphabet *Alphabet) string

*

  • 以传入的字母表对输入值进行base58编码。
  • params:
  • input:待编码字节数组
  • alphabet:base58编码字母表
  • return:
  • string

Types

type Alphabet

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

base58 字母表结构。

func NewAlphabet

func NewAlphabet(alphabet string) *Alphabet

*

  • 创建base58 字母表结构,字母表必须是58个字符
  • params:
  • 自定义的字母表字符
  • return:
  • *Alphabet *

Jump to

Keyboard shortcuts

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