-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
40 lines (39 loc) · 936 Bytes
/
index.js
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
/**
* @param {Object} req Request Object
* @param {Object} res Response Object
* @returns
*/
exports.make = function(req, res) {
return {
/**
* @param {String} key
* @param {String} txnid
* @param {Number | String} amount
* @param {String} productinfo
* @param {String} firstname
* @param {String} email
* @param {String} salt
* @returns sha-key
*/
basic: function(key, txnid, amount, productinfo, firstname, email, salt) {
var shasum = crypto.createHash("sha512"),
dataSequence =
key +
"|" +
txnid +
"|" +
amount +
"|" +
productinfo +
"|" +
firstname +
"|" +
email +
"|||||||||||" +
salt;
var resultKey = shasum.update(dataSequence).digest("hex");
var data = JSON.stringify(resultKey);
return data;
}
};
};