1
0
mirror of https://github.com/silenceper/wechat.git synced 2026-02-11 08:12:26 +08:00

update golangci (#349)

* update golangci
This commit is contained in:
silenceper
2020-11-26 12:25:57 +08:00
committed by GitHub
parent 185baa5d12
commit c0da806e03
9 changed files with 38 additions and 34 deletions

View File

@@ -20,7 +20,7 @@ const (
SignTypeHMACSHA256 = `HMAC-SHA256`
)
//EncryptMsg 加密消息
// EncryptMsg 加密消息
func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encrtptMsg []byte, err error) {
defer func() {
if e := recover(); e != nil {
@@ -38,7 +38,7 @@ func EncryptMsg(random, rawXMLMsg []byte, appID, aesKey string) (encrtptMsg []by
return
}
//AESEncryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
// AESEncryptMsg ciphertext = AES_Encrypt[random(16B) + msg_len(4B) + rawXMLMsg + appId]
//参考github.com/chanxuehong/wechat.v2
func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphertext []byte) {
const (
@@ -76,7 +76,7 @@ func AESEncryptMsg(random, rawXMLMsg []byte, appID string, aesKey []byte) (ciphe
return
}
//DecryptMsg 消息解密
// DecryptMsg 消息解密
func DecryptMsg(appID, encryptedMsg, aesKey string) (random, rawMsgXMLBytes []byte, err error) {
defer func() {
if e := recover(); e != nil {