wx ding aes
1.0.0
WeChat open platform, enterprise WeChat, DingTalk third-party callback interface AES encryption and decryption library
npm install wx-ding-aes --save
/* javascript */
const aes = require ( 'wx-ding-aes' )
/* typescript */
import * as aes from 'wx-ding-aes'
text
: the cipher text sent by WeChat/DingTalk to the callback interface
encodingAESKey
: encodingAESKey when creating the package
return
: For DingTalk, the return value is a JSON string. You can useJSON.parse
to get the JSON object.For enterprise WeChat and WeChat development platform, the return value is an encrypted xml string, which can be processed using an xml parsing library.
const text = 'xxx'
const encodingAESKey = 'xxx'
const res = aes . decode ( text , encodingAESKey )
text
: Content that needs to be encrypted
encodingAESKey
: encodingAESKey when creating the package
key
:
- For DingTalk, please refer to
$key
in the official documentation.- For Enterprise WeChat, refer to
CorpID
in the official documentation- For the WeChat open platform, please refer to the message body encryption in the official documentation. The description is appid.
return
: encrypted ciphertext
const text = 'xxx'
const encodingAESKey = 'xxx'
const key = 'xxx'
const res = aes . encode ( text , encodingAESKey , key )