Files
Mickael Kerjean 1125998944 maintain (bcrypt): make local plugin faster
the local plugin would go through bcrypt for every single call which
can be annoying at it makes things slower. By reducing the number of
rounds, we're making it quicker to use the local plugin.

Since a few weeks, every endpoint that relies on bcrypt are rate
limited so this shouldn't make things easier for an attacker to break in :)
2022-09-28 07:30:12 +10:00

13 lines
276 B
JavaScript

import bcrypt from "bcryptjs";
const ROUND = 5;
export function bcrypt_password(password) {
return new Promise((done, error) => {
bcrypt.hash(password, ROUND, (err, hash) => {
if (err) return error(err);
done(hash);
});
});
}