Skip to content

Instantly share code, notes, and snippets.

@glenntnorton
Created February 7, 2018 19:24
Show Gist options
  • Save glenntnorton/d7cb608f5e5bd22b06b15b25ac9b1015 to your computer and use it in GitHub Desktop.
Save glenntnorton/d7cb608f5e5bd22b06b15b25ac9b1015 to your computer and use it in GitHub Desktop.
Quick PHP Password Hashing
<?php
$passwd = "swordfish";
$phash = password_hash($passwd, PASSWORD_DEFAULT);
if(password_verify($passwd, $phash)) {
echo "passwords match\n";
}
else {
echo "passwords do not match\n";
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment