if ($res['hash'] != '') { $look_hash = $res['hash']; } } } else { if ($_POST['random_id'] != '') { $random = new LoomRandom(); $id = $random->random_id(); $idhash = ''; $passphrase = ''; } elseif ($_POST['id_hash'] != '') { $idhash = $client->sha256($client->hex2bin($id)); } elseif ($_POST['random_passphrase'] != '') { require_once "Diceware.php"; if (!isset($diceware)) { $diceware = new Diceware(); } $passphrase = $diceware->random_words(5); $id = ''; $idhash = ''; } elseif ($_POST['hash_passphrase'] != '') { $hash = $client->sha256($passphrase); $id = $client->hash2location($hash); $idhash = ''; } } } if ($page == 'grid') { print_grid(); } else { if ($page == 'archive') {
public function actionPassword() { $diceware = new Diceware(); $password = $diceware->get_phrase($this->module->dicewareLength, $this->module->dicewareExtraDigit, $this->module->dicewareExtraChar); echo json_encode($password); }