This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function xml2array($x) | |
{ | |
return json_decode(json_encode(simplexml_load_string($x)),true); | |
} | |
?> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const net = require('net') | |
net.createServer(client => { | |
client.once('data', data => { | |
client.write(Buffer.from([5, 0])); | |
client.once('data', data => { | |
data = [...data]; | |
let ver = data.shift(); | |
let cmd = data.shift(); //1: connect, 2: bind, 3: udp | |
let rsv = data.shift(); |