aboutsummaryrefslogtreecommitdiff
path: root/Functions/pbkdf2promise.js
blob: ac63f43a128db707ba9bc8b8b30b5a0ed5d1c41f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const crypto  = require('node:crypto');

function pbkdf2(password, salt, iterations, keylen, digest) {
	return new Promise((resolve, reject) => {
		crypto.pbkdf2(password, salt, iterations, keylen, digest, (err, res) => {
			if (err)
				reject(err);
			else
				resolve(res);
		});
	});
}

exports.pbkdf2 = pbkdf2;