codec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2025 License: GPL-3.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	EscapeHtmlString   = html.EscapeString
	UnescapeHtmlString = html.UnescapeString
	StrConvUnquote     = strconv.Unquote
	StrConvQuote       = strconv.Quote
)
View Source
var DoubleDecodeUrl = func(i string) (string, error) {
	raw, err := url.QueryUnescape(i)
	if err != nil {
		return "", err
	}

	return url.QueryUnescape(raw)
}
View Source
var DoubleEncodeUrl = func(i interface{}) string {
	return url.QueryEscape(EncodeUrlCode(i))
}
View Source
var PathEscape = url.PathEscape

Functions

func Base32Padding

func Base32Padding(i string) string

func Base64Padding

func Base64Padding(i string) string

func CharDetect

func CharDetect(raw interface{}) ([]chardet.Result, error)

func CharDetectBest

func CharDetectBest(raw interface{}) (*chardet.Result, error)

func DecodeBase32

func DecodeBase32(i string) ([]byte, error)

func DecodeBase64

func DecodeBase64(i string) ([]byte, error)

func DecodeBase64Url

func DecodeBase64Url(i interface{}) ([]byte, error)

func DecodeHex

func DecodeHex(i string) ([]byte, error)

func EncodeBase32

func EncodeBase32(i interface{}) string

func EncodeBase64

func EncodeBase64(i interface{}) string

func EncodeBase64Url

func EncodeBase64Url(i interface{}) string

func EncodeHtmlEntity

func EncodeHtmlEntity(i interface{}) string

func EncodeHtmlEntityHex

func EncodeHtmlEntityHex(i interface{}) string

func EncodeToHex

func EncodeToHex(i interface{}) string

func EncodeUrlCode

func EncodeUrlCode(i interface{}) string

func EscapeInvalidUTF8Byte

func EscapeInvalidUTF8Byte(s []byte) string

func ForceQueryUnescape

func ForceQueryUnescape(s string) string

func GB18030ToUtf8

func GB18030ToUtf8(s []byte) ([]byte, error)

func GBKSafeString

func GBKSafeString(s []byte) (string, error)

func GbkToUtf8

func GbkToUtf8(s []byte) ([]byte, error)

func HTTPChunkedEncode

func HTTPChunkedEncode(raw []byte) []byte

func HZGB2312ToUtf8

func HZGB2312ToUtf8(s []byte) ([]byte, error)

func HmacMD5

func HmacMD5(key, data interface{}) []byte

func HmacSM3

func HmacSM3(key, data interface{}) []byte

func HmacSha1

func HmacSha1(key, data interface{}) []byte

func HmacSha256

func HmacSha256(key, data interface{}) []byte

func HmacSha512

func HmacSha512(key, data interface{}) []byte

func MMH3Hash128

func MMH3Hash128(i interface{}) string

func MMH3Hash128x64

func MMH3Hash128x64(i interface{}) string

func MMH3Hash32

func MMH3Hash32(i interface{}) int64

func Md5

func Md5(i interface{}) string

func MustPKCS5UnPadding

func MustPKCS5UnPadding(origData []byte) ([]byte, error)

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) []byte

func PathUnescape

func PathUnescape(s string) (string, error)

func QueryEscape

func QueryEscape(s string) string

func QueryUnescape

func QueryUnescape(s string) (string, error)

func RandomUpperAndLower

func RandomUpperAndLower(s string) string

func Sha1

func Sha1(i interface{}) string

func Sha224

func Sha224(i interface{}) string

func Sha256

func Sha256(i interface{}) string

func Sha384

func Sha384(i interface{}) string

func Sha512

func Sha512(i interface{}) string

func StrConvQuoteHex

func StrConvQuoteHex(s string) string

func StrConvUnquoteForce

func StrConvUnquoteForce(s string) []byte

func UrlUnicodeDecode

func UrlUnicodeDecode(s string) string

func Utf8ToGB18030

func Utf8ToGB18030(s []byte) ([]byte, error)

func Utf8ToGbk

func Utf8ToGbk(s []byte) ([]byte, error)

func Utf8ToHZGB2312

func Utf8ToHZGB2312(s []byte) ([]byte, error)

func ZeroPadding

func ZeroPadding(origin []byte, blockSize int) []byte

func ZeroUnPadding

func ZeroUnPadding(originData []byte) []byte

Types

This section is empty.

Jump to

Keyboard shortcuts

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