Skip to main content

codec

成员函数函数描述/介绍
codec.AESCBCDecrypt
codec.AESCBCDecryptWithPKCS7Padding
codec.AESCBCDecryptWithZeroPadding
codec.AESCBCEncrypt
codec.AESCBCEncryptWithPKCS7Padding
codec.AESCBCEncryptWithZeroPadding
codec.AESDecrypt
codec.AESECBDecrypt
codec.AESECBDecryptWithPKCS7Padding
codec.AESECBDecryptWithZeroPadding
codec.AESECBEncrypt
codec.AESECBEncryptWithPKCS7Padding
codec.AESECBEncryptWithZeroPadding
codec.AESEncrypt
codec.AESGCMDecrypt
codec.AESGCMDecryptWithNonceSize12
codec.AESGCMDecryptWithNonceSize16
codec.AESGCMEncrypt//AES GCM 加密后的payload shiro 1.4.2版本更换为了AES-GCM加密方式 func AESGCM_Encrypt(key []byte, Content []byte) string { block, := aes.NewCipher(key) nonc...
codec.AESGCMEncryptWithNonceSize12
codec.AESGCMEncryptWithNonceSize16//AES GCM 加密后的payload shiro 1.4.2版本更换为了AES-GCM加密方式 func AESGCM_Encrypt(key []byte, Content []byte) string { block, := aes.NewCipher(key) nonc...
codec.AutoDecode
codec.DESCBCDecrypt
codec.DESCBCEncrypt
codec.DESDecrypt
codec.DESECBDecrypt
codec.DESECBEncrypt
codec.DESEncrypt
codec.DecodeASCIIUnquote interprets s as a single-quoted, double-quoted, or backquoted Go string literal, returning the string value that s quotes. (If s is single-qu...
codec.DecodeBase32
codec.DecodeBase64
codec.DecodeBase64Url
codec.DecodeChunked
codec.DecodeHex
codec.DecodeHtmlUnescapeString unescapes entities like "<" to become "<". It unescapes a larger range of entities than EscapeString escapes. For example, "&aacu...
codec.DecodeUrl
codec.DoubleDecodeUrl
codec.DoubleEncodeUrl
codec.EncodeASCII
codec.EncodeBase32
codec.EncodeBase64
codec.EncodeBase64Url
codec.EncodeChunked
codec.EncodeHtml
codec.EncodeHtmlHex
codec.EncodeToHex
codec.EncodeToPrintable
codec.EncodeUrl
codec.EscapeHtmlEscapeString escapes special characters like "<" to become "<". It escapes only five such characters: <, >, >, ' and ". UnescapeString(Esc...
codec.EscapePathUrlPathEscape escapes the string so it can be safely placed inside a URL path segment, replacing special characters (including /) with %XX sequences as n...
codec.EscapeQueryUrl
codec.EscapeUrl
codec.FixUTF8
codec.GB18030ToUTF8
codec.GBKSafe
codec.GBKToUTF8
codec.HTMLChardet
codec.HTMLChardetBest
codec.HZGB2312ToUTF8
codec.HmacMD5
codec.HmacSM3
codec.HmacSha1
codec.HmacSha256
codec.HmacSha512
codec.MMH3Hash128
codec.MMH3Hash128x64
codec.MMH3Hash32
codec.Md5
codec.PKCS5Padding
codec.PKCS5UnPadding
codec.PKCS7Padding
codec.PKCS7UnPadding
codec.RC4Decrypt
codec.RC4Encrypt
codec.RSADecryptWithOAEP
codec.RSADecryptWithPKCS1v15DecryptWithPkcs1v15 将PEM格式的私钥与密文进行PKCS1v15解密,返回明文与错误
codec.RSAEncryptWithOAEP
codec.RSAEncryptWithPKCS1v15EncryptWithPkcs1v15 将PEM格式的公钥与数据进行PKCS1v15加密,返回密文与错误
codec.Sha1
codec.Sha224
codec.Sha256
codec.Sha384
codec.Sha512
codec.Sm2DecryptAsn1
codec.Sm2DecryptAsn1WithPassword
codec.Sm2DecryptC1C2C3
codec.Sm2DecryptC1C2C3WithPassword
codec.Sm2DecryptC1C3C2
codec.Sm2DecryptC1C3C2WithPassword
codec.Sm2EncryptAsn1
codec.Sm2EncryptC1C2C3
codec.Sm2EncryptC1C3C2
codec.Sm2GenerateHexKeyPair
codec.Sm2GeneratePemKeyPair
codec.Sm3
codec.Sm4CBCDecrypt
codec.Sm4CBCEncrypt
codec.Sm4CFBDecrypt
codec.Sm4CFBEncrypt
codec.Sm4EBCDecrypt
codec.Sm4EBCEncrypt
codec.Sm4ECBDecrypt
codec.Sm4ECBEncrypt
codec.Sm4GCMDecrypt
codec.Sm4GCMEncrypt
codec.Sm4OFBDecrypt
codec.Sm4OFBEncrypt
codec.StrconvQuote
codec.StrconvUnquoteUnquote interprets s as a single-quoted, double-quoted, or backquoted Go string literal, returning the string value that s quotes. (If s is single-qu...
codec.TripleDESCBCDecrypt
codec.TripleDESCBCEncrypt
codec.TripleDESDecrypt
codec.TripleDESECBDecrypt
codec.TripleDESECBEncrypt
codec.TripleDESEncrypt
codec.UTF8ToGB18030
codec.UTF8ToGBK
codec.UTF8ToHZGB2312
codec.UnescapePathUrl
codec.UnescapeQueryUrl
codec.UnicodeDecode
codec.UnicodeEncode
codec.ZeroPadding
codec.ZeroUnPadding

函数定义#

AESCBCDecrypt#

详细描述#

定义#

AESCBCDecrypt(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESCBCDecryptWithPKCS7Padding#

详细描述#

定义#

AESCBCDecryptWithPKCS7Padding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESCBCDecryptWithZeroPadding#

详细描述#

定义#

AESCBCDecryptWithZeroPadding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESCBCEncrypt#

详细描述#

定义#

AESCBCEncrypt(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESCBCEncryptWithPKCS7Padding#

详细描述#

定义#

AESCBCEncryptWithPKCS7Padding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESCBCEncryptWithZeroPadding#

详细描述#

定义#

AESCBCEncryptWithZeroPadding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESDecrypt#

详细描述#

定义#

AESDecrypt(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESECBDecrypt#

详细描述#

定义#

AESECBDecrypt(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESECBDecryptWithPKCS7Padding#

详细描述#

定义#

AESECBDecryptWithPKCS7Padding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESECBDecryptWithZeroPadding#

详细描述#

定义#

AESECBDecryptWithZeroPadding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESECBEncrypt#

详细描述#

定义#

AESECBEncrypt(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESECBEncryptWithPKCS7Padding#

详细描述#

定义#

AESECBEncryptWithPKCS7Padding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESECBEncryptWithZeroPadding#

详细描述#

定义#

AESECBEncryptWithZeroPadding(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESEncrypt#

详细描述#

定义#

AESEncrypt(key []byte, i any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
iany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESGCMDecrypt#

详细描述#

定义#

AESGCMDecrypt(key []byte, data any, nonce []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
nonce[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESGCMDecryptWithNonceSize12#

详细描述#

定义#

AESGCMDecryptWithNonceSize12(key []byte, data any, nonce []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
nonce[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESGCMDecryptWithNonceSize16#

详细描述#

定义#

AESGCMDecryptWithNonceSize16(key []byte, data any, nonce []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
nonce[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESGCMEncrypt#

详细描述#

//AES GCM 加密后的payload shiro 1.4.2版本更换为了AES-GCM加密方式

func AES_GCM_Encrypt(key []byte, Content []byte) string {    block, _ := aes.NewCipher(key)    nonce := make([]byte, 16)    io.ReadFull(rand.Reader, nonce)    aesgcm, _ := cipher.NewGCMWithNonceSize(block, 16)    ciphertext := aesgcm.Seal(nil, nonce, Content, nil)    return base64.StdEncoding.EncodeToString(append(nonce, ciphertext...))}

定义#

AESGCMEncrypt(key []byte, data any, nonceRaw []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
nonceRaw[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESGCMEncryptWithNonceSize12#

详细描述#

定义#

AESGCMEncryptWithNonceSize12(key []byte, data any, nonceRaw []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
nonceRaw[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AESGCMEncryptWithNonceSize16#

详细描述#

//AES GCM 加密后的payload shiro 1.4.2版本更换为了AES-GCM加密方式

func AES_GCM_Encrypt(key []byte, Content []byte) string {    block, _ := aes.NewCipher(key)    nonce := make([]byte, 16)    io.ReadFull(rand.Reader, nonce)    aesgcm, _ := cipher.NewGCMWithNonceSize(block, 16)    ciphertext := aesgcm.Seal(nil, nonce, Content, nil)    return base64.StdEncoding.EncodeToString(append(nonce, ciphertext...))}

定义#

AESGCMEncryptWithNonceSize16(key []byte, data any, nonceRaw []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
nonceRaw[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

AutoDecode#

详细描述#

定义#

AutoDecode(i any) []*AutoDecodeResult

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]*AutoDecodeResult

DESCBCDecrypt#

详细描述#

定义#

DESCBCDecrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DESCBCEncrypt#

详细描述#

定义#

DESCBCEncrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DESDecrypt#

详细描述#

定义#

DESDecrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DESECBDecrypt#

详细描述#

定义#

DESECBDecrypt(key []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DESECBEncrypt#

详细描述#

定义#

DESECBEncrypt(key []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DESEncrypt#

详细描述#

定义#

DESEncrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DecodeASCII#

详细描述#

Unquote interprets s as a single-quoted, double-quoted, or backquoted Go string literal, returning the string value that s quotes. (If s is single-quoted, it would be a Go character literal; Unquote returns the corresponding one-character string.)

定义#

DecodeASCII(s string) (string, error)

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

DecodeBase32#

详细描述#

定义#

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

参数#

参数名参数类型参数解释
istring

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DecodeBase64#

详细描述#

定义#

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

参数#

参数名参数类型参数解释
istring

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DecodeBase64Url#

详细描述#

定义#

DecodeBase64Url(i any) ([]byte, error)

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DecodeChunked#

详细描述#

定义#

DecodeChunked(raw []byte) ([]byte, error)

参数#

参数名参数类型参数解释
raw[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DecodeHex#

详细描述#

定义#

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

参数#

参数名参数类型参数解释
istring

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

DecodeHtml#

详细描述#

UnescapeString unescapes entities like "<" to become "<". It unescapes a larger range of entities than EscapeString escapes. For example, "á" unescapes to "á", as does "á" and "á". UnescapeString(EscapeString(s)) == s always holds, but the converse isn't always true.

定义#

DecodeHtml(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

DecodeUrl#

详细描述#

定义#

DecodeUrl(s string) (string, error)

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

DoubleDecodeUrl#

详细描述#

定义#

DoubleDecodeUrl(i string) (string , error )

参数#

参数名参数类型参数解释
istring

返回值#

返回值(顺序)返回值类型返回值解释
string``
error``

DoubleEncodeUrl#

详细描述#

定义#

DoubleEncodeUrl(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeASCII#

详细描述#

定义#

EncodeASCII(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeBase32#

详细描述#

定义#

EncodeBase32(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeBase64#

详细描述#

定义#

EncodeBase64(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeBase64Url#

详细描述#

定义#

EncodeBase64Url(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeChunked#

详细描述#

定义#

EncodeChunked(raw []byte) []byte

参数#

参数名参数类型参数解释
raw[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

EncodeHtml#

详细描述#

定义#

EncodeHtml(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeHtmlHex#

详细描述#

定义#

EncodeHtmlHex(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeToHex#

详细描述#

定义#

EncodeToHex(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeToPrintable#

详细描述#

定义#

EncodeToPrintable(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EncodeUrl#

详细描述#

定义#

EncodeUrl(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EscapeHtml#

详细描述#

EscapeString escapes special characters like "<" to become "<". It escapes only five such characters: <, >, >, ' and ". UnescapeString(EscapeString(s)) == s always holds, but the converse isn't always true.

定义#

EscapeHtml(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EscapePathUrl#

详细描述#

PathEscape escapes the string so it can be safely placed inside a URL path segment, replacing special characters (including /) with %XX sequences as needed.

定义#

EscapePathUrl(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EscapeQueryUrl#

详细描述#

定义#

EscapeQueryUrl(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

EscapeUrl#

详细描述#

定义#

EscapeUrl(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

FixUTF8#

详细描述#

定义#

FixUTF8(s []byte) string

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1string

GB18030ToUTF8#

详细描述#

定义#

GB18030ToUTF8(s []byte) ([]byte, error)

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

GBKSafe#

详细描述#

定义#

GBKSafe(s []byte) (string, error)

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

GBKToUTF8#

详细描述#

定义#

GBKToUTF8(s []byte) ([]byte, error)

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

HTMLChardet#

详细描述#

定义#

HTMLChardet(raw any) ([]chardet.Result, error)

参数#

参数名参数类型参数解释
rawany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]chardet.Result
r2error

HTMLChardetBest#

详细描述#

定义#

HTMLChardetBest(raw any) (*chardet.Result, error)

参数#

参数名参数类型参数解释
rawany

返回值#

返回值(顺序)返回值类型返回值解释
r1*chardet.Result
r2error

HZGB2312ToUTF8#

详细描述#

定义#

HZGB2312ToUTF8(s []byte) ([]byte, error)

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

HmacMD5#

详细描述#

定义#

HmacMD5(key any, data any) []byte

参数#

参数名参数类型参数解释
keyany
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

HmacSM3#

详细描述#

定义#

HmacSM3(key any, data any) []byte

参数#

参数名参数类型参数解释
keyany
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

HmacSha1#

详细描述#

定义#

HmacSha1(key any, data any) []byte

参数#

参数名参数类型参数解释
keyany
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

HmacSha256#

详细描述#

定义#

HmacSha256(key any, data any) []byte

参数#

参数名参数类型参数解释
keyany
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

HmacSha512#

详细描述#

定义#

HmacSha512(key any, data any) []byte

参数#

参数名参数类型参数解释
keyany
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

MMH3Hash128#

详细描述#

定义#

MMH3Hash128(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

MMH3Hash128x64#

详细描述#

定义#

MMH3Hash128x64(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

MMH3Hash32#

详细描述#

定义#

MMH3Hash32(i any) int64

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1int64

Md5#

详细描述#

定义#

Md5(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

PKCS5Padding#

详细描述#

定义#

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

参数#

参数名参数类型参数解释
ciphertext[]byte
blockSizeint

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

PKCS5UnPadding#

详细描述#

定义#

PKCS5UnPadding(origData []byte) []byte

参数#

参数名参数类型参数解释
origData[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

PKCS7Padding#

详细描述#

定义#

PKCS7Padding(src []byte) []byte

参数#

参数名参数类型参数解释
src[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

PKCS7UnPadding#

详细描述#

定义#

PKCS7UnPadding(src []byte) []byte

参数#

参数名参数类型参数解释
src[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

RC4Decrypt#

详细描述#

定义#

RC4Decrypt(cipherKey []byte, cipherText []byte) ([]byte, error)

参数#

参数名参数类型参数解释
cipherKey[]byte
cipherText[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

RC4Encrypt#

详细描述#

定义#

RC4Encrypt(cipherKey []byte, plainText []byte) ([]byte, error)

参数#

参数名参数类型参数解释
cipherKey[]byte
plainText[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

RSADecryptWithOAEP#

详细描述#

定义#

RSADecryptWithOAEP(pemPriBytes []byte, data any) ([]byte, error)

参数#

参数名参数类型参数解释
pemPriBytes[]byte
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

RSADecryptWithPKCS1v15#

详细描述#

DecryptWithPkcs1v15 将PEM格式的私钥与密文进行PKCS1v15解密,返回明文与错误

Example:

dec, err := tls.DecryptWithPkcs1v15(pemBytes, enc)

定义#

RSADecryptWithPKCS1v15(pemPriBytes []byte, data any) ([]byte, error)

参数#

参数名参数类型参数解释
pemPriBytes[]byte
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

RSAEncryptWithOAEP#

详细描述#

定义#

RSAEncryptWithOAEP(pemBytes []byte, data any) ([]byte, error)

参数#

参数名参数类型参数解释
pemBytes[]byte
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

RSAEncryptWithPKCS1v15#

详细描述#

EncryptWithPkcs1v15 将PEM格式的公钥与数据进行PKCS1v15加密,返回密文与错误

Example:

enc, err := tls.EncryptWithPkcs1v15(pemBytes, "hello")

定义#

RSAEncryptWithPKCS1v15(pemBytes []byte, data any) ([]byte, error)

参数#

参数名参数类型参数解释
pemBytes[]byte
dataany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sha1#

详细描述#

定义#

Sha1(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

Sha224#

详细描述#

定义#

Sha224(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

Sha256#

详细描述#

定义#

Sha256(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

Sha384#

详细描述#

定义#

Sha384(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

Sha512#

详细描述#

定义#

Sha512(i any) string

参数#

参数名参数类型参数解释
iany

返回值#

返回值(顺序)返回值类型返回值解释
r1string

Sm2DecryptAsn1#

详细描述#

定义#

Sm2DecryptAsn1(priKey []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
priKey[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2DecryptAsn1WithPassword#

详细描述#

定义#

Sm2DecryptAsn1WithPassword(priKey []byte, data []byte, password []byte) ([]byte, error)

参数#

参数名参数类型参数解释
priKey[]byte
data[]byte
password[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2DecryptC1C2C3#

详细描述#

定义#

Sm2DecryptC1C2C3(priKey []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
priKey[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2DecryptC1C2C3WithPassword#

详细描述#

定义#

Sm2DecryptC1C2C3WithPassword(priKey []byte, data []byte, password []byte) ([]byte, error)

参数#

参数名参数类型参数解释
priKey[]byte
data[]byte
password[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2DecryptC1C3C2#

详细描述#

定义#

Sm2DecryptC1C3C2(priKey []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
priKey[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2DecryptC1C3C2WithPassword#

详细描述#

定义#

Sm2DecryptC1C3C2WithPassword(priKey []byte, data []byte, password []byte) ([]byte, error)

参数#

参数名参数类型参数解释
priKey[]byte
data[]byte
password[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2EncryptAsn1#

详细描述#

定义#

Sm2EncryptAsn1(pubKey []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
pubKey[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2EncryptC1C2C3#

详细描述#

定义#

Sm2EncryptC1C2C3(pubKey []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
pubKey[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2EncryptC1C3C2#

详细描述#

定义#

Sm2EncryptC1C3C2(pubKey []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
pubKey[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm2GenerateHexKeyPair#

详细描述#

定义#

Sm2GenerateHexKeyPair() ([]byte, []byte, error)

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2[]byte
r3error

Sm2GeneratePemKeyPair#

详细描述#

定义#

Sm2GeneratePemKeyPair() ([]byte, []byte, error)

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2[]byte
r3error

Sm3#

详细描述#

定义#

Sm3(raw any) []byte

参数#

参数名参数类型参数解释
rawany

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

Sm4CBCDecrypt#

详细描述#

定义#

Sm4CBCDecrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4CBCEncrypt#

详细描述#

定义#

Sm4CBCEncrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4CFBDecrypt#

详细描述#

定义#

Sm4CFBDecrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4CFBEncrypt#

详细描述#

定义#

Sm4CFBEncrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4EBCDecrypt#

详细描述#

定义#

Sm4EBCDecrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4EBCEncrypt#

详细描述#

定义#

Sm4EBCEncrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4ECBDecrypt#

详细描述#

定义#

Sm4ECBDecrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4ECBEncrypt#

详细描述#

定义#

Sm4ECBEncrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4GCMDecrypt#

详细描述#

定义#

Sm4GCMDecrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4GCMEncrypt#

详细描述#

定义#

Sm4GCMEncrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4OFBDecrypt#

详细描述#

定义#

Sm4OFBDecrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

Sm4OFBEncrypt#

详细描述#

定义#

Sm4OFBEncrypt(key []byte, data any, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
dataany
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

StrconvQuote#

详细描述#

定义#

StrconvQuote(s string) string

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

StrconvUnquote#

详细描述#

Unquote interprets s as a single-quoted, double-quoted, or backquoted Go string literal, returning the string value that s quotes. (If s is single-quoted, it would be a Go character literal; Unquote returns the corresponding one-character string.)

定义#

StrconvUnquote(s string) (string, error)

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

TripleDESCBCDecrypt#

详细描述#

定义#

TripleDESCBCDecrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

TripleDESCBCEncrypt#

详细描述#

定义#

TripleDESCBCEncrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

TripleDESDecrypt#

详细描述#

定义#

TripleDESDecrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

TripleDESECBDecrypt#

详细描述#

定义#

TripleDESECBDecrypt(key []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

TripleDESECBEncrypt#

详细描述#

定义#

TripleDESECBEncrypt(key []byte, data []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

TripleDESEncrypt#

详细描述#

定义#

TripleDESEncrypt(key []byte, data []byte, iv []byte) ([]byte, error)

参数#

参数名参数类型参数解释
key[]byte
data[]byte
iv[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

UTF8ToGB18030#

详细描述#

定义#

UTF8ToGB18030(s []byte) ([]byte, error)

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

UTF8ToGBK#

详细描述#

定义#

UTF8ToGBK(s []byte) ([]byte, error)

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

UTF8ToHZGB2312#

详细描述#

定义#

UTF8ToHZGB2312(s []byte) ([]byte, error)

参数#

参数名参数类型参数解释
s[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte
r2error

UnescapePathUrl#

详细描述#

定义#

UnescapePathUrl(s string) (string, error)

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

UnescapeQueryUrl#

详细描述#

定义#

UnescapeQueryUrl(s string) (string, error)

参数#

参数名参数类型参数解释
sstring

返回值#

返回值(顺序)返回值类型返回值解释
r1string
r2error

UnicodeDecode#

详细描述#

定义#

UnicodeDecode(i string) string

参数#

参数名参数类型参数解释
istring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

UnicodeEncode#

详细描述#

定义#

UnicodeEncode(i string) string

参数#

参数名参数类型参数解释
istring

返回值#

返回值(顺序)返回值类型返回值解释
r1string

ZeroPadding#

详细描述#

定义#

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

参数#

参数名参数类型参数解释
origin[]byte
blockSizeint

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte

ZeroUnPadding#

详细描述#

定义#

ZeroUnPadding(originData []byte) []byte

参数#

参数名参数类型参数解释
originData[]byte

返回值#

返回值(顺序)返回值类型返回值解释
r1[]byte