How to use the HmacSHA384 function from crypto-js
Find comprehensive JavaScript crypto-js.HmacSHA384 code examples handpicked from public code repositorys.
GitHub: ICObench/data-api
8 9 10 11 12 13 14 15 16 17
} get(action, callback, data = {}) { let dataJSON = JSON.stringify(data); let sign = CryptoJS.HmacSHA384(dataJSON, this.privateKey); sign = CryptoJS.enc.Base64.stringify(sign); request.post(this.apiUrl + action, { headers: {
20
27
4
+ 3 other calls in file
GitHub: btsecom/api-sample
15 16 17 18 19 20 21 22 23 24
const nonce = Date.now().toString(); const bodyStr = body ? JSON.stringify(body) : ''; return { 'btse-api': API_KEY, 'btse-nonce': nonce, 'btse-sign': HmacSHA384(`${endpoint}${nonce}${bodyStr}`, API_SECRET_KEY).toString(), }; }; module.exports = {
16
8
2
+ 5 other calls in file
45 46 47 48 49 50 51 52 53 54
try { if (!this.ifAuthenticated) { await this.getApiKeys(); const authNonce = Math.floor(Date.now() / 100) + "00000000000000000" + Math.floor(Date.now() / 100); const authPayload = 'AUTH' + authNonce const authSig = crypto.HmacSHA384(authPayload, this.apiParams.apiSecret).toString(crypto.enc.Hex); const payload = { apiKey: this.apiParams.apiKey, authSig, authNonce,
13
16
7
72 73 74 75 76 77 78 79 80
payload.authNonce = +nonce } else { console.warn('Only wss v2 is now supported, sorry!') return {} } payload.authSig = HmacSHA384(payload.authPayload, apiSecret).toString(enc.Hex) return payload }
2
3
0
+ 2 other calls in file
GitHub: mnismt/MyHash
89 90 91 92 93 94 95 96 97 98
}, hmacsha256() { return CryptoJS.HmacSHA256(this.text, this.serect).toString(); }, hmacsha384() { return CryptoJS.HmacSHA384(this.text, this.serect).toString(); }, hmacsha512() { return CryptoJS.HmacSHA512(this.text, this.serect).toString(); },
0
1
1
+ 17 other calls in file
127 128 129 130 131 132 133 134 135 136
}; /* SHA384 hashing */ exports.SHA384 = function(text, key) { try { return typeof key !== undefined ? CryptoJS.HmacSHA384(text, key) : CryptoJS.SHA384(text); } catch (err) { throw "ERROR - utils/utilidades.js _ SHA384 method"; }
1
0
2
+ 3 other calls in file
6 7 8 9 10 11 12 13 14 15
var request = JSON.stringify({ orderId: 'BACKEND-16a92e0f94e5f100' //NODE: We can only cancel orders that belong to the source associated with our API key }); var signature = CryptoJS.HmacSHA384(request, SECRET).toString(CryptoJS.enc.Hex); var a = Request.post( { headers: {
1
0
4
+ 5 other calls in file
8 9 10 11 12 13 14 15 16 17
// Variable d'environnement require('dotenv').config(); exports.signup = (req, res, next) => { const emailCryptoJs = cryptoJs.HmacSHA384(req.body.email, `${process.env.crypto_key}`).toString(); bcrypt.hash(req.body.password, 12) .then(hash => { const user = new User({ email: emailCryptoJs,
0
0
1
+ 7 other calls in file
GitHub: reklamup/api-examples
6 7 8 9 10 11 12 13 14 15
const requestUrl = "/external/v3/app-report?startDate=2022-10-08&endDate=2022-10-09"; const requestMethod = "GET"; // The authentication signature is hashed using the apiSecret const signature = CryptoJS.HmacSHA384(`${apiKey}.${nonce}.${requestUrl}.${requestMethod}`, apiSecret).toString(); //example request fetch(`https://api.reklamup.com${requestUrl}`, { method: requestMethod,
0
0
1
crypto-js.AES is the most popular function in crypto-js (907 examples)