We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents d5ec21d + 750b07b commit da2735cCopy full SHA for da2735c
1 file changed
Sha512/compute_trans_hashSHA2.js
@@ -0,0 +1,18 @@
1
+var sha512 = require('js-sha512');
2
+var apiLogin ="2Kfn5S7x7D";
3
+var transId ="60115585081";
4
+var amount ='12.00';
5
+var signatureKey = '56E529FE6C63D60E545F84686096E6AA01D5E18A119F18A130F7CFB3983104216979E95D84C91BDD382AA0875264A63940A2D0AA5548F6023B4C78A9D52C18DA';
6
+var textToHash = "^" + apiLogin + "^" + transId + "^" + amount + "^";
7
+
8
+function generateSHA512(textToHash, signatureKey)
9
+{
10
+ if (textToHash != null && signatureKey != null) {
11
+ var sig = sha512.hmac(Buffer.from(signatureKey, 'hex'), textToHash).toUpperCase();
12
+ console.log("Computed SHA512 Hash: " + sig + "\n");
13
+ } else {
14
+ console.log("Either Signature key or the text to hash is empty \n");
15
+ }
16
+}
17
18
+generateSHa512(textToHash, signatureKey);
0 commit comments