MCPcopy Create free account
hub / github.com/node-modules/utility / hmac

Function hmac

src/crypto.ts:103–108  ·  view source on GitHub ↗
(algorithm: string, key: string, data: string | Buffer, encoding?: BinaryToTextEncoding)

Source from the content-addressed store, hash-verified

101 * @return {String} digest string.
102 */
103export function hmac(algorithm: string, key: string, data: string | Buffer, encoding?: BinaryToTextEncoding): string {
104 encoding = encoding || 'base64';
105 const hmac = createHmac(algorithm, key);
106 hmac.update(data as string, Buffer.isBuffer(data) ? 'binary' : 'utf8');
107 return hmac.digest(encoding);
108}
109
110/**
111 * Base64 encode string.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…