-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserver.js
More file actions
49 lines (46 loc) · 1.25 KB
/
Copy pathserver.js
File metadata and controls
49 lines (46 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
var express = require('express');
var checksum = require('json-checksum');
// const crypto = require('crypto');
// const hash = crypto.createHash('sha256');
// var strigify = require('node-stringify');
var app = express();
var obj= {
"name" : "demouser1@gmail.com",
"address" :
[
{
"test" : "teststring"
}
]
};
//{"header":null,"body":{"usrLst":[{"usrLoginInfo":{"usrLoginId":"demouser1@gmail.com","usrPwd":"YZSvwS+DFC4mNarfkdhL9A=="}}]}};
/* {
"header":null,
"body":
{
"usrLst":
[
{
"usrLoginInfo":
{
"usrLoginId":"demouser1@gmail.com",
"usrPwd":"YZSvwS+DFC4mNarfkdhL9A=="
}
}
]
}
}; */
console.log(JSON.stringify(obj));
var checksum=checksum(obj);
console.log(checksum);
// console.log(obj.toString());
// console.log(strigify(obj));
// hash.update("{\"header\":null,\"body\":{\"usrLst\":[{\"usrLoginInfo\":{\"usrLoginId\":\"demouser1@gmail.com\",\"usrPwd\":\"YZSvwS+DFC4mNarfkdhL9A==\"}}]}}");
// console.log(hash.digest('hex'));
app.get('/', function (req, res) {
res.send('Hello World!');
console.log(c2);
});
app.listen(3000, function () {
console.log('Example app listening on port 3000!');
});