Skip to content

Instantly share code, notes, and snippets.

@YurePereira
Created January 28, 2018 06:34
Show Gist options
  • Select an option

  • Save YurePereira/92022ba31927f016c6fe3b26660d6e0f to your computer and use it in GitHub Desktop.

Select an option

Save YurePereira/92022ba31927f016c6fe3b26660d6e0f to your computer and use it in GitHub Desktop.
Verificando-se nossas hashes armazemadas precisam ser atualizadas
<?php
$password = 'myPassword';
$hash = '$2y$11$60E.YbPVdujZB5pt71C51.FTKINFQnkdyPFttgeRtLdUbOlZTD0.S';
$options = array('cost' => 12);
if (password_verify($password, $hash)) {
if (password_needs_rehash($hash, PASSWORD_DEFAULT, $options)) {
$newHash = password_hash($password, PASSWORD_DEFAULT, $options);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment