MCPcopy
hub / github.com/strongloop/loopback / generateKey

Function generateKey

common/models/application.js:16–25  ·  view source on GitHub ↗
(hmacKey, algorithm, encoding)

Source from the content-addressed store, hash-verified

14const crypto = require('crypto');
15
16function generateKey(hmacKey, algorithm, encoding) {
17 hmacKey = hmacKey || 'loopback';
18 algorithm = algorithm || 'sha1';
19 encoding = encoding || 'hex';
20 const hmac = crypto.createHmac(algorithm, hmacKey);
21 const buf = crypto.randomBytes(32);
22 hmac.update(buf);
23 const key = hmac.digest(encoding);
24 return key;
25}
26
27/**
28 * Manage client applications and organize their users.

Callers 1

application.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…