strutil

package
v0.2.6 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AesDecrypt

func AesDecrypt(encrypted, cip string) (string, error)

*

  • @name: aes 解密
  • @description:
  • @param {*} encrypted 加密字符串
  • @param {string} cip 密文
  • @return {*}

func AesEncrypt

func AesEncrypt(origin, cip string) (string, error)

*

  • @name: AES加密 cbc
  • @description:
  • @param {*} origin 需要加密的字符串
  • @param {string} cip 密文
  • @return {*}

func Base64Decoding

func Base64Decoding(s string) string

func Base64Encoding

func Base64Encoding(s string) string

base64 加密

func GetRandomNumber

func GetRandomNumber(l int) string

随机生成数字字符串

func GetRandomPureString

func GetRandomPureString(l int) string

随机生成纯字符串

func GetRandomString

func GetRandomString(l int) string

随机生成字符串

func JoinStringArr

func JoinStringArr(strs, str string, dep string) string

*

  • @name: 向字符串增加字符
  • @description:
  • @param {*} strs 使用dep隔开的字符串
  • @param {string} str 需要添加的字符串
  • @param {string} dep
  • @return {*}

func Md5

func Md5(s string) string

func PKCS7Padding

func PKCS7Padding(plaintext []byte, blockSize int) []byte

func Sha1

func Sha1(s string) string

func UnPKCS7Padding

func UnPKCS7Padding(origData []byte) []byte

func Uuid

func Uuid() string

Types

type WxEncryptedData added in v0.2.6

type WxEncryptedData struct {
	OpenId    string `json:"openId"`
	NickName  string `json:"nickName"`
	Gender    string `json:"gender"`
	City      string `json:"city"`
	Province  string `json:"province"`
	Country   string `json:"country"`
	AvatarUrl string `json:"avatarUrl"`
	UnionId   string `json:"unionId"`
	Watermark struct {
		Appid     string `json:"appid"`
		Timestamp string `json:"timestamp"`
	} `json:"watermark"`
}

func AesDecryptWxEncryptedData added in v0.2.6

func AesDecryptWxEncryptedData(encryptData, sessionKey, iv string) (WxEncryptedData, error)

Jump to

Keyboard shortcuts

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