MCPcopy
hub / github.com/node-webot/weixin-robot / makeAuthQuery

Function makeAuthQuery

test/bootstrap.js:19–28  ·  view source on GitHub ↗
(token)

Source from the content-addressed store, hash-verified

17 * @param {String} token 微信token
18 */
19var makeAuthQuery = function(token){
20 token = token || default_token;
21 var q = {
22 timestamp: new Date().getTime(),
23 nonce: parseInt((Math.random() * 10e10), 10)
24 }
25 var s = [token, q.timestamp, q.nonce].sort().join('');
26 q.signature = require('crypto').createHash('sha1').update(s).digest('hex');
27 return q;
28}
29
30/**
31 * @method makeRequest 获取发送请求的函数

Callers 2

makeRequestFunction · 0.85
authorize.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected