We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3f8005d commit 7631cbaCopy full SHA for 7631cba
1 file changed
cli/generate-passwd.php
@@ -0,0 +1,15 @@
1
+<?php
2
+
3
+echo 'WARNING: Password will be visible on the command line and will be stored in your history.' . PHP_EOL;
4
+echo 'Don\'t use this script if other people have access to your shell (history)!' . PHP_EOL . PHP_EOL;
5
6
+echo 'Enter your password: ';
7
8
+$password = trim(fgets(STDIN));
9
10
+if (empty($password)) {
11
+ echo 'ERROR: Password empty...';
12
+ exit;
13
+}
14
15
+echo password_hash($argv[0], PASSWORD_DEFAULT, ['cost' => 12]) . PHP_EOL;
0 commit comments