base58

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrChecksum = errors.New("校验和错误")

ErrChecksum 表示校验编码字符串的校验和不与校验和进行验证。

View Source
var ErrInvalidFormat = errors.New("格式无效:版本和/或校验和字节丢失")

ErrInvalidFormat 表示校验编码字符串的格式无效。

Functions

func CheckDecode

func CheckDecode(input string) (result []byte, version byte, err error)

CheckDecode 解码使用 CheckEncode 编码的字符串并验证校验和。 参数:

  • input: 使用 CheckEncode 编码的字符串

返回:

  • result: 解码后的字节切片
  • version: 版本字节
  • err: 错误信息,如果有

func CheckEncode

func CheckEncode(input []byte, version byte) string

CheckEncode 前置一个版本字节并附加一个四字节校验和。 参数:

  • input: 输入的字节切片
  • version: 版本字节

返回:

  • 使用 base58 编码的字符串

func Decode

func Decode(b string) []byte

Decode 将修改后的 base58 字符串解码为字节切片。 参数:

  • b: base58 编码的字符串

返回:

  • 解码后的字节切片

func Encode

func Encode(b []byte) string

Encode 将字节切片编码为修改后的 base58 字符串。 参数:

  • b: 待编码的字节切片

返回:

  • base58 编码的字符串

Types

This section is empty.

Jump to

Keyboard shortcuts

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