Browse Source

prox

master
zeus 4 years ago
parent
commit
96a766ff27
  1. 13
      swarmlab-app/src/run/app.js

13
swarmlab-app/src/run/app.js

@ -427,8 +427,17 @@ cors(corsOptions), (req, res, next) => {
// socket // socket
// *************************************************** // ***************************************************
function getSHA256ofJSON(input){ //function getSHA256ofJSON(input){
return require("crypto").createHash("sha256").update(JSON.stringify(input)).digest("hex"); // return require("crypto").createHash("sha256").update(JSON.stringify(input)).digest("hex");
//}
const getSHA256ofJSON = (data: string, inputEncoding, encoding) => {
if (!data) {
return '';
}
inputEncoding = inputEncoding || 'utf-8';
encoding = encoding || 'hex';
const hash = crypto.createHash('md5');
return hash.update(JSON.stringify(data), inputEncoding).digest(encoding);
} }
//var getkey = function getkey(key) { //var getkey = function getkey(key) {

Loading…
Cancel
Save