18 lines
358 B
PHP
Executable file
18 lines
358 B
PHP
Executable file
#!/usr/bin/env php
|
|
<?php
|
|
|
|
use Symfony\Component\Security\Core\Encoder\BCryptPasswordEncoder;
|
|
|
|
require_once __DIR__.'/../vendor/autoload.php';
|
|
|
|
if (isset($argv[1])) {
|
|
$password = $argv[1];
|
|
} else {
|
|
$password = trim(readline('Password: '));
|
|
}
|
|
|
|
$encoder = new BCryptPasswordEncoder(13);
|
|
$hash = $encoder->encodePassword($password, '');
|
|
|
|
echo "$hash\n";
|