13require_once(
$baseDir.
'/lib/_autoload.php');
 
   16echo 
"Enter password: ";
 
   20    echo 
"Need at least one character for a password\n";
 
   25foreach (array_chunk(hash_algos(), 6) as $chunk) {
 
   26    foreach ($chunk as 
$algo) {
 
   32echo 
"The following hashing algorithms are available:\n".$table.
"\n";
 
   33echo 
"Which one do you want? [sha256] ";
 
   39if (!in_array(strtolower(
$algo), hash_algos(), 
true)) {
 
   40    echo 
"Hashing algorithm '$algo' is not supported\n";
 
   44echo 
"Do you want to use a salt? (yes/no) [yes] ";
 
   45$s = (trim(fgets(STDIN)) == 
'no') ? 
'' : 
'S';
 
   47echo 
"\n  ".SimpleSAML\Utils\Crypto::pwHash(
$password, strtoupper(
$s.$algo)).
"\n\n";
 
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
if(empty($password)) $table