util

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2019 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptMsg

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

AESDecryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2

func AESEncryptMsg

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

AESEncryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId] 参考:github.com/chanxuehong/wechat.v2

func DecryptMsg

func DecryptMsg(appID, aesKey, encryptedMsg string) (random, rawMsgXMLBytes []byte, err error)

DecryptMsg 消息解密

func EncryptMsg

func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encrtptMsg []byte, err error)

EncryptMsg 加密消息

func MD5Sum

func MD5Sum(txt string) (sum string)

MD5Sum 计算 32 位长度的 MD5 sum

func MsgSign

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

func SecureCompareString

func SecureCompareString(given, actual string) bool

func Sign

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

Types

This section is empty.

Jump to

Keyboard shortcuts

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