pasar de status 1 a status 2 listo
This commit is contained in:
@@ -20,4 +20,15 @@ const encriptar = (password) => {
|
||||
return bcrypt.hashSync(password, Number(process.env.SALT_ROUNDS));
|
||||
};
|
||||
|
||||
module.exports = { comparar, encriptar };
|
||||
const generarPassword = () => {
|
||||
let length = 8;
|
||||
let charset =
|
||||
'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789';
|
||||
let password = '';
|
||||
|
||||
for (let i = 0, n = charset.length; i < length; ++i)
|
||||
password += charset.charAt(Math.floor(Math.random() * n));
|
||||
return password;
|
||||
};
|
||||
|
||||
module.exports = { comparar, encriptar, generarPassword };
|
||||
|
||||
Reference in New Issue
Block a user