Skip to content

Instantly share code, notes, and snippets.

@longbill
longbill / wxcrypto.js
Last active March 4, 2022 08:43
微信公众号消息加密解密nodejs模块
const crypto = require('crypto');
const debug = require('debug')('wxcrypto');
/**
* 微信公众号消息加密解密,支持 node > 8.0
*
* var WXCrypto = require('this module');
* var wx = new WXCrypto(token, aesKey, appid);
*
* var [err, encryptedXML] = wx.encrypt(xml, timestamp, nonce);