Created
August 14, 2020 02:20
-
-
Save parzibyte/4462e0bed3ddf7a4f82ecb0fdcf72e90 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Importamos paquete | |
const bcrypt = require("bcryptjs"); | |
// Primero vamos a hashear la contraseña | |
const palabraSecretaTextoPlano = "hunter2"; | |
// Entre más rondas, mejor protección, pero más consumo de recursos. 10 está bien | |
const rondasDeSal = 10; | |
bcrypt.hash(palabraSecretaTextoPlano, rondasDeSal, (err, palabraSecretaEncriptada) => { | |
if (err) { | |
console.log("Error hasheando:", err); | |
} else { | |
console.log("Y hasheada es: " + palabraSecretaEncriptada); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment