Documentation ¶
Overview ¶
提供一些实用函数
Index ¶
- func AESDecryptMsg(encryptedMsg []byte, AppId string, AESKey [32]byte) (random, rawXMLMsg []byte, err error)
- func AESEncryptMsg(random, rawXMLMsg []byte, AppId string, AESKey [32]byte) (encryptedMsg []byte)
- func AESKeyDecode(encodedAESKey string) (AESKey []byte, err error)
- func MsgSign(token, timestamp, nonce, encryptedMsg string) (signature string)
- func Sign(token, timestamp, nonce string) (signature string)
- func WXVersion(userAgent string) (x, y, z int, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AESDecryptMsg ¶
func AESDecryptMsg(encryptedMsg []byte, AppId string, AESKey [32]byte) (random, rawXMLMsg []byte, err error)
encryptedMsg = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + AppId]
func AESEncryptMsg ¶
encryptedMsg = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + AppId]
func AESKeyDecode ¶
把长度为 43 的字符串 base64 decode 到 32 字节的 []byte
encodedAESKey 由 a-z,A-Z,0-9 组成, 一般在微信管理后台随机生成
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.