util

package
v1.1.8 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

提供一些实用函数

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptData

func AESDecryptData(cipherText []byte, aesKey []byte, iv []byte) (rawData []byte, err error)

func AESDecryptMsg

func AESDecryptMsg(ciphertext []byte, aesKey []byte) (random, rawXMLMsg, appId []byte, err error)

ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]

func AESEncryptMsg

func AESEncryptMsg(random, rawXMLMsg []byte, appId string, aesKey []byte) (ciphertext []byte)

ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]

func BoolPtr

func BoolPtr(v bool) *bool

Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.

func Float32Ptr

func Float32Ptr(v float32) *float32

Float32 is a helper routine that allocates a new float32 value to store v and returns a pointer to it.

func Float64Ptr

func Float64Ptr(v float64) *float64

Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it.

func Int32Ptr

func Int32Ptr(v int32) *int32

Int32 is a helper routine that allocates a new int32 value to store v and returns a pointer to it.

func Int64Ptr

func Int64Ptr(v int64) *int64

Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.

func IntPtr

func IntPtr(v int) *int

Int is a helper routine that allocates a new int value to store v and returns a pointer to it.

func MsgSign

func MsgSign(token, timestamp, nonce, encryptedMsg string) (signature string)

MsgSign 微信公众号/企业号 消息体签名.

func Sign

func Sign(token, timestamp, nonce string) (signature string)

Sign 微信公众号 url 签名.

func StringPtr

func StringPtr(v string) *string

String is a helper routine that allocates a new string value to store v and returns a pointer to it.

func ToLower

func ToLower(s string) string

ToLower 返回字符串对应的小写版本.

如果确定 s 是[a-zA-Z0-9_-] 的组合, 那么可以用这个函数, 否则请用 strings.ToLower!

func Uint32Ptr

func Uint32Ptr(v uint32) *uint32

Uint32 is a helper routine that allocates a new uint32 value to store v and returns a pointer to it.

func Uint64Ptr

func Uint64Ptr(v uint64) *uint64

Uint64 is a helper routine that allocates a new uint64 value to store v and returns a pointer to it.

Types

This section is empty.

Jump to

Keyboard shortcuts

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