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

Function argon2

lib/internal/crypto/argon2.js:62–87  ·  view source on GitHub ↗

* @param {'argon2d' | 'argon2i' | 'argon2id'} algorithm * @param {object} parameters * @param {ArrayBufferLike} parameters.message * @param {ArrayBufferLike} parameters.nonce * @param {number} parameters.parallelism * @param {number} parameters.tagLength * @param {number} parameters.memory *

(algorithm, parameters, callback)

Source from the content-addressed store, hash-verified

60 * @param {Function} callback
61 */
62function argon2(algorithm, parameters, callback) {
63 parameters = check(algorithm, parameters);
64
65 validateFunction(callback, 'callback');
66
67 const job = new Argon2Job(
68 kCryptoJobAsync,
69 parameters.message,
70 parameters.nonce,
71 parameters.parallelism,
72 parameters.tagLength,
73 parameters.memory,
74 parameters.passes,
75 parameters.secret,
76 parameters.associatedData,
77 parameters.type);
78
79 job.ondone = (error, result) => {
80 if (error !== undefined)
81 return FunctionPrototypeCall(callback, job, error);
82 const buf = Buffer.from(result);
83 return FunctionPrototypeCall(callback, job, null, buf);
84 };
85
86 job.run();
87}
88
89/**
90 * @param {'argon2d' | 'argon2i' | 'argon2id'} algorithm

Callers 1

measureAsyncFunction · 0.85

Calls 3

checkFunction · 0.70
fromMethod · 0.45
runMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…