From b51d568b996fce5b74cd78e186dfc68d71c8ea83 Mon Sep 17 00:00:00 2001 From: zeus Date: Sun, 29 Nov 2020 19:34:45 +0200 Subject: [PATCH] prox --- swarmlab-app/src/run/app.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/swarmlab-app/src/run/app.js b/swarmlab-app/src/run/app.js index 3c2538d..15c782b 100755 --- a/swarmlab-app/src/run/app.js +++ b/swarmlab-app/src/run/app.js @@ -430,13 +430,13 @@ cors(corsOptions), (req, res, next) => { //function getSHA256ofJSON(input){ // return require("crypto").createHash("sha256").update(JSON.stringify(input)).digest("hex"); //} -const getSHA256ofJSON = (data: string, inputEncoding, encoding) => { +function getSHA256ofJSON(data, inputEncoding, encoding){ if (!data) { return ''; } inputEncoding = inputEncoding || 'utf-8'; encoding = encoding || 'hex'; - const hash = crypto.createHash('md5'); + const hash = require("crypto").createHash('md5'); return hash.update(JSON.stringify(data), inputEncoding).digest(encoding); }