encode

package
v0.0.0-...-9afdcff Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Base32Decode

func Base32Decode(encoded string) ([]byte, error)

Base32Decode base32解码

func Base32Encode

func Base32Encode(bytes []byte) string

Base32Encode base32编码

func Base58Decode

func Base58Decode(encoded string) ([]byte, error)

Base58Decode base58解码

func Base58Encode

func Base58Encode(bytes []byte) string

Base58Encode base58编码

func Base64Decode

func Base64Decode(encoded string) ([]byte, error)

Base64Decode base64解码

func Base64Encode

func Base64Encode(bytes []byte) string

Base64Encode base64编码

func HexDecode

func HexDecode(encoded string) ([]byte, error)

HexDecode 16进制解码

func HexEncode

func HexEncode(bytes []byte) string

HexEncode 16进制编码

func MsgpackMarshal

func MsgpackMarshal(v any) ([]byte, error)

MsgpackMarshal 进行msgpack序列化

func MsgpackUnmarshal

func MsgpackUnmarshal(bytes []byte, v any) error

MsgpackUnmarshal 进行msgpack反序列化

func SanitizeDecode

func SanitizeDecode(encoded string, v any) error

SanitizeDecode 解码脱敏后的编码值

func SanitizeEncode

func SanitizeEncode(v any) (string, error)

SanitizeEncode 针对于任意类型进行脱敏编码

func Uint32Decode

func Uint32Decode(bytes []byte) uint32

Uint32Decode 使用小端序解码uint32

func Uint32Encode

func Uint32Encode(v uint32) []byte

Uint32Encode 使用小端序编码uint32

func Uint64Decode

func Uint64Decode(bytes []byte) uint64

Uint64Decode 使用小端序解码uint64

func Uint64Encode

func Uint64Encode(v uint64) []byte

Uint64Encode 使用小端序编码uint64

Types

type SanitizeEncoder

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

SanitizeEncoder 使用msgpack对任意类型进行序列化,之后使用自定义码集的base58进行编码. 如果数据不想直接展示出来,可使用这种方式 进行编解码,从而起到脱敏的效果,且编码出的内容比较短, 注意这只起到脱敏的效果,并不是安全地加解密操作

func NewSanitizeEncoder

func NewSanitizeEncoder(alphabet string) *SanitizeEncoder

NewSanitizeEncoder 通过自定义码集创建一个脱敏编码对象

func (*SanitizeEncoder) Decode

func (enc *SanitizeEncoder) Decode(encoded string, v any) error

func (*SanitizeEncoder) Encode

func (enc *SanitizeEncoder) Encode(v any) (string, error)

Jump to

Keyboard shortcuts

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