Skip to content

Instantly share code, notes, and snippets.

@nicordev
Created September 27, 2019 16:44
Show Gist options
  • Save nicordev/856257233bd6f23c22cd1e58c4246223 to your computer and use it in GitHub Desktop.
Save nicordev/856257233bd6f23c22cd1e58c4246223 to your computer and use it in GitHub Desktop.
Hash a password using php in the command line
<?php
echo "Password: ";
fscanf(STDIN, "%s\n", $password);
echo "$password\nHash using password_hash() and PASSWORD_DEFAULT: ";
echo password_hash($password, PASSWORD_DEFAULT);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment