Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CakePHP Hashs Generator (Security.salt e Security.cipherSeed) - Gerador de Hashs (Security.salt e Security.cipherSeed) para CakePHP
<html>
<head>
<title>CakePHP Gerador de Hash</title>
</head>
<body>
<h1>Gerador de Hash Para CakePHP</h1>
<p>Recarregue a p&aacute;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>
@ronaldaraujo

This comment has been minimized.

Copy link

@ronaldaraujo ronaldaraujo commented Aug 14, 2014

Muito bom!

@gomes2191

This comment has been minimized.

Copy link

@gomes2191 gomes2191 commented Jan 17, 2015

Vlw

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment