From 7f59612f4ad1061c99ae53ef92baf04511b7f9af Mon Sep 17 00:00:00 2001 From: Joel Kronqvist Date: Sat, 24 Jun 2023 07:49:18 +0000 Subject: Changed to PBKDF2 --- Functions/pbkdf2promise.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 Functions/pbkdf2promise.js (limited to 'Functions/pbkdf2promise.js') diff --git a/Functions/pbkdf2promise.js b/Functions/pbkdf2promise.js new file mode 100644 index 0000000..ac63f43 --- /dev/null +++ b/Functions/pbkdf2promise.js @@ -0,0 +1,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; -- cgit v1.2.3