var express = require('express');
var router = express.Router();
const crypto = require('crypto');

const TOKEN = 'ryerh';

const checkSignature = (signature, timestamp, nonce, token) => {
  const sha1 = crypto.createHash('sha1');
  const joined = [token, timestamp, nonce].sort().join('');

  sha1.update(joined);
  const encoded = sha1.digest('hex');
  return encoded === signature;
};

/* GET users listing. */
router.get('/', function(req, res, next) {
  const s = req.query.signature;
  const ts = req.query.timestamp;
  const n = req.query.nonce;
  const isMatch = checkSignature(s, ts, n, TOKEN);
  res.send(isMatch ? s : '');
});

module.exports = router;

@@ -459,16 +459,24 @@
  const s
+ignature
  = req.q
@@ -500,17 +500,24 @@
  const t
-s
+imestamp
  = req.q
@@ -541,16 +541,20 @@
  const n
+once
  = req.q
@@ -577,41 +577,97 @@
 nst 
-isMatch = checkSignature(s, ts, n
+echostr = req.query.echostr;%0A  const isMatch = checkSignature(signature, timestamp, nonce
 , TO
@@ -693,17 +693,23 @@
 Match ? 
-s
+echostr
  : '');%0A

update check echostr