MCPcopy Index your code
hub / github.com/nodejs/node / Hmac

Function Hmac

lib/internal/crypto/hash.js:172–184  ·  view source on GitHub ↗
(hmac, key, options)

Source from the content-addressed store, hash-verified

170};
171
172function Hmac(hmac, key, options) {
173 if (!(this instanceof Hmac))
174 return new Hmac(hmac, key, options);
175 validateString(hmac, 'hmac');
176 const encoding = getStringOption(options, 'encoding');
177 key = prepareSecretKey(key, encoding);
178 this[kHandle] = new _Hmac();
179 this[kHandle].init(hmac, key);
180 this[kState] = {
181 [kFinalized]: false,
182 };
183 FunctionPrototypeCall(LazyTransform, this, options);
184}
185
186ObjectSetPrototypeOf(Hmac.prototype, LazyTransform.prototype);
187ObjectSetPrototypeOf(Hmac, LazyTransform);

Callers

nothing calls this directly

Calls 3

getStringOptionFunction · 0.85
prepareSecretKeyFunction · 0.85
initMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…