Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created August 14, 2020 02:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/363bccfe1ace0a2352f91381c5ed548e to your computer and use it in GitHub Desktop.
Save parzibyte/363bccfe1ace0a2352f91381c5ed548e to your computer and use it in GitHub Desktop.
// Recuperamos la contraseña de la petición
const palabraSecretaTextoPlano = "hunter2";
// Y la guardada en la base de datos
const palabraSecretaEncriptada = "$2a$10$P9yvh9ew5ZueNRjQGX4Eiui9jNhaKJCX24mRsrWSNvj.0O2FjNSB2";
// Comprobamos...
const palabraSecretaValida = await bcrypt.compare(palabraSecretaTextoPlano, palabraSecretaEncriptada);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment