sdencoding

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package sdencoding hex, base64 等编码

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Encoding

type Encoding interface {
	Encode(data []byte) []byte
	EncodeString(data []byte) string
	Decode(encoded []byte) ([]byte, error)
	DecodeString(encoded string) ([]byte, error)
}
var (
	Base64Std Encoding = base64Encoding{base64.StdEncoding}
	Base64Url Encoding = base64Encoding{base64.URLEncoding}
)
var (
	Hex Encoding = hexEncoding{}
)

type TextEncoding

type TextEncoding interface {
	Encode(s string) ([]byte, error)
	Decode(encoded []byte) (string, error)
}
var (
	GBK     TextEncoding = textEncoding{simplifiedchinese.GBK}
	GB2312  TextEncoding = textEncoding{simplifiedchinese.HZGB2312}
	GB18030 TextEncoding = textEncoding{simplifiedchinese.GB18030}
)

Jump to

Keyboard shortcuts

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