-
-
Save adeonir/5297022602d682623dc0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>CakePHP Gerador de Hash</title> | |
</head> | |
<body> | |
<h1>Gerador de Hash Para CakePHP</h1> | |
<p>Recarregue a página para gerar novos hashs!</p> | |
<?php | |
function geraSenha($tamanho = 15, $minusculas = true, $maiusculas = true, $numeros = true, $simbolos = true) | |
{ | |
$lmin = 'abcdefghijkmnopqrstuvwxyz'; | |
$lmai = 'ABCDEFGHIJKLMNPQRSTUVWXYZ'; | |
$num = '234567892345678923456789'; | |
$simb = '!@#$%*-!@#$%*-!@#$%*-'; | |
$retorno = ''; | |
$caracteres = ''; | |
if ($minusculas) $caracteres .= $lmin; | |
if ($maiusculas) $caracteres .= $lmai; | |
if ($numeros) $caracteres .= $num; | |
if ($simbolos) $caracteres .= $simb; | |
$len = strlen($caracteres); | |
for ($n = 1; $n <= $tamanho; $n++) { | |
$rand = mt_rand(1, $len); | |
$retorno .= $caracteres[$rand-1]; | |
} | |
return $retorno; | |
} | |
echo '<h3>Security.salt</h3>'; | |
echo '<p>'.geraSenha(41,true,true,true,false).'</p>'; | |
echo '<h3>Security.cipherSeed</h3>'; | |
echo '<p>'.geraSenha(29,false,false,true,false).'</p>'; | |
?> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment