Documentation ¶
Index ¶
- Variables
- func AESCBCDecryptWithPKCS7Padding(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESCBCDecryptWithZeroPadding(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESCBCEncryptWithPKCS7Padding(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESCBCEncryptWithZeroPadding(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESECBDecryptWithPKCS7Padding(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESECBDecryptWithZeroPadding(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESECBEncrypt(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESECBEncryptWithZeroPadding(key []byte, i interface{}, iv []byte) ([]byte, error)
- func AESGCMDecrypt(key []byte, data interface{}, nonce []byte) ([]byte, error)
- func AESGCMDecryptWithNonceSize(key []byte, data interface{}, nonceRaw []byte, nonceSize int) ([]byte, error)
- func AESGCMDecryptWithNonceSize12(key []byte, data interface{}, nonce []byte) ([]byte, error)
- func AESGCMDecryptWithNonceSize16(key []byte, data interface{}, nonce []byte) ([]byte, error)
- func AESGCMEncrypt(key []byte, data interface{}, nonceRaw []byte) ([]byte, error)
- func AESGCMEncryptWithNonceSize(key []byte, data interface{}, nonceRaw []byte, nonceSize int) ([]byte, error)
- func AESGCMEncryptWithNonceSize12(key []byte, data interface{}, nonceRaw []byte) ([]byte, error)
- func AnyToBytes(i interface{}) (result []byte)
- func AnyToString(i interface{}) string
- func Atob(i string) bool
- func Atof(i string) float64
- func Atoi(i string) int
- func CharDetect(raw interface{}) ([]chardet.Result, error)
- func CharDetectBest(raw interface{}) (*chardet.Result, error)
- func DESCBCDec(key []byte, data []byte, iv []byte) ([]byte, error)
- func DESCBCDecEx(key, data, iv []byte, isTripleDES bool) ([]byte, error)
- func DESCBCEnc(key []byte, data []byte, iv []byte) ([]byte, error)
- func DESCBCEncEx(key []byte, data []byte, iv []byte, isTripleDES bool) ([]byte, error)
- func DESECBDec(key []byte, data []byte) ([]byte, error)
- func DESECBDecEx(key []byte, data []byte, isTripleDES bool) ([]byte, error)
- func DESECBEnc(key []byte, data []byte) ([]byte, error)
- func DESECBEncEx(key []byte, data []byte, isTripleDES bool) ([]byte, error)
- func DecodeBase32(i string) ([]byte, error)
- func DecodeBase64(i string) ([]byte, error)
- func DecodeBase64Url(i interface{}) ([]byte, error)
- func DecodeHex(i string) ([]byte, error)
- func Decodebig5(s []byte) ([]byte, error)
- func Decodegbk(s []byte) ([]byte, error)
- func EncodeBase32(i interface{}) string
- func EncodeBase64(i interface{}) string
- func EncodeBase64Url(i interface{}) string
- func EncodeByType(t string, i interface{}) string
- func EncodeHtmlEntity(i interface{}) string
- func EncodeHtmlEntityHex(i interface{}) string
- func EncodeToHex(i interface{}) string
- func EncodeUrlCode(i interface{}) string
- func Encodebig5(s []byte) ([]byte, error)
- func EscapeInvalidUTF8Byte(s []byte) string
- func ForceQueryUnescape(s string) string
- func GB18030ToUtf8(s []byte) ([]byte, error)
- func GBKSafeString(s []byte) (string, error)
- func GbkToUtf8(s []byte) ([]byte, error)
- func GenerateSM2PrivateKeyHEX() ([]byte, []byte, error)
- func GenerateSM2PrivateKeyPEM() ([]byte, []byte, error)
- func HTTPChunkedDecode(raw []byte) ([]byte, error)
- func HTTPChunkedDecodeWithRestBytes(raw []byte) ([]byte, []byte)
- func HTTPChunkedDecoderWithRestBytes(raw io.Reader) ([]byte, []byte, io.Reader, error)
- func HTTPChunkedEncode(raw []byte) []byte
- func HZGB2312ToUtf8(s []byte) ([]byte, error)
- func HmacMD5(key, data interface{}) []byte
- func HmacSM3(key, data interface{}) []byte
- func HmacSha1(key, data interface{}) []byte
- func HmacSha256(key, data interface{}) []byte
- func HmacSha512(key, data interface{}) []byte
- func IsGBK(data []byte) bool
- func IsUtf8(data []byte) bool
- func Itoa(i int) string
- func JsonUnicodeDecode(i string) string
- func JsonUnicodeEncode(i string) string
- func MMH3Hash128(i interface{}) string
- func MMH3Hash128x64(i interface{}) string
- func MMH3Hash32(i interface{}) int64
- func Md5(i interface{}) string
- func MustPKCS5UnPadding(origData []byte) ([]byte, error)
- func PKCS5Padding(ciphertext []byte, blockSize int) []byte
- func PKCS5UnPadding(origData []byte) []byte
- func PathUnescape(s string) (string, error)
- func QueryEscape(s string) string
- func QueryUnescape(s string) (string, error)
- func RC4Decrypt(cipherKey []byte, cipherText []byte) ([]byte, error)
- func RC4Encrypt(cipherKey []byte, plainText []byte) ([]byte, error)
- func RandomUpperAndLower(s string) string
- func ReadHTTPChunkedDataWithFixed(ret []byte) (data []byte, fixedChunked []byte, rest []byte)
- func SM2DecryptASN1(priKey []byte, data []byte) ([]byte, error)
- func SM2DecryptASN1WithPassword(priKey []byte, data []byte, password []byte) ([]byte, error)
- func SM2DecryptC1C2C3(priKey []byte, data []byte) ([]byte, error)
- func SM2DecryptC1C2C3WithPassword(priKey []byte, data []byte, password []byte) ([]byte, error)
- func SM2DecryptC1C3C2(priKey []byte, data []byte) ([]byte, error)
- func SM2DecryptC1C3C2WithPassword(priKey []byte, data []byte, password []byte) ([]byte, error)
- func SM2EncryptASN1(pubKey []byte, data []byte) ([]byte, error)
- func SM2EncryptC1C2C3(pubKey []byte, data []byte) ([]byte, error)
- func SM2EncryptC1C3C2(pubKey []byte, data []byte) ([]byte, error)
- func SM3(raw interface{}) []byte
- func SM4CBCDec(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4CBCEnc(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4CFBDec(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4CFBEnc(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4ECBDec(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4ECBEnc(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4GCMDec(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4GCMEnc(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4OFBDec(key []byte, data interface{}, iv []byte) ([]byte, error)
- func SM4OFBEnc(key []byte, data interface{}, iv []byte) ([]byte, error)
- func Sha1(i interface{}) string
- func Sha224(i interface{}) string
- func Sha256(i interface{}) string
- func Sha384(i interface{}) string
- func Sha512(i interface{}) string
- func StrConvUnquoteForce(s string) []byte
- func TripleDES_CBCDec(key []byte, data []byte, iv []byte) ([]byte, error)
- func TripleDES_CBCEnc(key []byte, data []byte, iv []byte) ([]byte, error)
- func TripleDES_ECBDec(key []byte, data []byte) ([]byte, error)
- func TripleDES_ECBEnc(key []byte, data []byte) ([]byte, error)
- func UrlUnicodeDecode(s string) string
- func Utf8ToGB18030(s []byte) ([]byte, error)
- func Utf8ToGbk(s []byte) ([]byte, error)
- func Utf8ToHZGB2312(s []byte) ([]byte, error)
- func ZeroPadding(origin []byte, blockSize int) []byte
- func ZeroUnPadding(originData []byte) []byte
- type AutoDecodeResult
Constants ¶
This section is empty.
Variables ¶
View Source
var AESCBCDecrypt = AESCBCDecryptWithPKCS7Padding
View Source
var AESCBCEncrypt = AESCBCEncryptWithPKCS7Padding
View Source
var AESECBDecrypt = AESECBDecryptWithPKCS7Padding
View Source
var AESECBEncryptWithPKCS7Padding = AESECBEncrypt
View Source
var AESGCMEncryptWithNonceSize16 = AESGCMEncrypt
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 EscapeHtmlString = html.EscapeString
View Source
var PKCS7Padding = sm4.PKCS7Padding
View Source
var PKCS7UnPadding = sm4.PKCS7UnPadding
View Source
var PathEscape = url.PathEscape
View Source
var StrConvQuote = func(s string) string { raw := []byte(s) var buf bytes.Buffer buf.WriteString("\"") for _, b := range raw { switch true { case b >= 'a' && b <= 'z': fallthrough case b >= 'A' && b <= 'Z': fallthrough case b >= '0' && b <= '9': buf.WriteByte(b) default: buf.WriteString(fmt.Sprintf(`\x%02x`, b)) } } buf.WriteString("\"") return buf.String() }
View Source
var StrConvUnquote = strconv.Unquote
View Source
var UnescapeHtmlString = html.UnescapeString
Functions ¶
func 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...)) }
func AnyToBytes ¶ added in v1.2.6
func AnyToBytes(i interface{}) (result []byte)
func AnyToString ¶ added in v1.2.6
func AnyToString(i interface{}) string
func CharDetect ¶
func CharDetectBest ¶
func DESCBCDecEx ¶ added in v1.2.4
func DESCBCEncEx ¶ added in v1.2.4
func DESECBDecEx ¶ added in v1.2.4
func DESECBEncEx ¶ added in v1.2.4
func DecodeBase32 ¶ added in v1.2.4
func DecodeBase64 ¶
func DecodeBase64Url ¶
func EncodeBase32 ¶ added in v1.2.4
func EncodeBase32(i interface{}) string
func EncodeBase64 ¶
func EncodeBase64(i interface{}) string
func EncodeBase64Url ¶
func EncodeBase64Url(i interface{}) string
func EncodeByType ¶ added in v1.2.8
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 ForceQueryUnescape ¶ added in v1.2.8
func GB18030ToUtf8 ¶
func GBKSafeString ¶
func HTTPChunkedDecode ¶
func HTTPChunkedDecodeWithRestBytes ¶ added in v1.2.6
func HTTPChunkedDecoderWithRestBytes ¶ added in v1.2.6
func HTTPChunkedEncode ¶
func HZGB2312ToUtf8 ¶
func HmacSha256 ¶
func HmacSha256(key, data interface{}) []byte
func HmacSha512 ¶
func HmacSha512(key, data interface{}) []byte
func JsonUnicodeDecode ¶
func JsonUnicodeEncode ¶
func MMH3Hash128 ¶
func MMH3Hash128(i interface{}) string
func MMH3Hash128x64 ¶
func MMH3Hash128x64(i interface{}) string
func MMH3Hash32 ¶
func MMH3Hash32(i interface{}) int64
func MustPKCS5UnPadding ¶ added in v1.2.2
func PKCS5Padding ¶
func PKCS5UnPadding ¶
func PathUnescape ¶
func QueryEscape ¶
func QueryUnescape ¶
func RandomUpperAndLower ¶
func ReadHTTPChunkedDataWithFixed ¶ added in v1.2.6
func StrConvUnquoteForce ¶ added in v1.2.8
func TripleDES_CBCDec ¶ added in v1.2.4
func TripleDES_CBCEnc ¶ added in v1.2.4
func TripleDES_ECBDec ¶ added in v1.2.4
func TripleDES_ECBEnc ¶ added in v1.2.4
func UrlUnicodeDecode ¶ added in v1.2.9
func Utf8ToGB18030 ¶
func Utf8ToHZGB2312 ¶
func ZeroPadding ¶
func ZeroUnPadding ¶
Types ¶
type AutoDecodeResult ¶
func AutoDecode ¶
func AutoDecode(i interface{}) []*AutoDecodeResult
Click to show internal directories.
Click to hide internal directories.