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

Function hkdf

lib/internal/crypto/hkdf.js:106–125  ·  view source on GitHub ↗
(hash, key, salt, info, length, callback)

Source from the content-addressed store, hash-verified

104}
105
106function hkdf(hash, key, salt, info, length, callback) {
107 ({
108 hash,
109 key,
110 salt,
111 info,
112 length,
113 } = validateParameters(hash, key, salt, info, length));
114
115 validateFunction(callback, 'callback');
116
117 const job = new HKDFJob(kCryptoJobAsync, hash, key, salt, info, length);
118
119 job.ondone = (error, bits) => {
120 if (error) return FunctionPrototypeCall(callback, job, error);
121 FunctionPrototypeCall(callback, job, null, bits);
122 };
123
124 job.run();
125}
126
127function hkdfSync(hash, key, salt, info, length) {
128 ({

Callers 3

measureAsyncFunction · 0.85

Calls 1

runMethod · 0.45

Tested by

no test coverage detected