aboutsummaryrefslogtreecommitdiff
path: root/Functions/pbkdf2promise.js
diff options
context:
space:
mode:
authorJoel Kronqvist <joelkronqvist@proton.me>2023-06-24 07:49:18 +0000
committerJoel Kronqvist <joelkronqvist@proton.me>2023-06-24 07:49:18 +0000
commit7f59612f4ad1061c99ae53ef92baf04511b7f9af (patch)
tree594a1a33660c34be5fc607e3d6b9f521a960ea04 /Functions/pbkdf2promise.js
parent53dfdded8181e6bf8987795813e128717ef9860c (diff)
downloadLYLLRuoka-7f59612f4ad1061c99ae53ef92baf04511b7f9af.tar.gz
LYLLRuoka-7f59612f4ad1061c99ae53ef92baf04511b7f9af.zip
Changed to PBKDF2
Diffstat (limited to 'Functions/pbkdf2promise.js')
-rw-r--r--Functions/pbkdf2promise.js14
1 files changed, 14 insertions, 0 deletions
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;