diff options
author | Joel Kronqvist <joelkronqvist@proton.me> | 2023-06-24 07:49:18 +0000 |
---|---|---|
committer | Joel Kronqvist <joelkronqvist@proton.me> | 2023-06-24 07:49:18 +0000 |
commit | 7f59612f4ad1061c99ae53ef92baf04511b7f9af (patch) | |
tree | 594a1a33660c34be5fc607e3d6b9f521a960ea04 /Functions/pbkdf2promise.js | |
parent | 53dfdded8181e6bf8987795813e128717ef9860c (diff) | |
download | LYLLRuoka-7f59612f4ad1061c99ae53ef92baf04511b7f9af.tar.gz LYLLRuoka-7f59612f4ad1061c99ae53ef92baf04511b7f9af.zip |
Changed to PBKDF2
Diffstat (limited to 'Functions/pbkdf2promise.js')
-rw-r--r-- | Functions/pbkdf2promise.js | 14 |
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; |