I'm looking for tool that generate random strings

justdude

Regular Member
Joined
Dec 17, 2008
Messages
220
Reaction score
72
well I can't explain name of this tool but I need, program, js, php or something that generate random letter, numbers. All coma seperated something like this:

weioufhhweiof, WOIFHWOIEFH1232, edfbeirf, IUU3HR934943, w9hfwe9iufbiwef, ieowferi, efidbcdsaoc, 9348y5349hrfedij, iewfbe

each day I need three strings like this above to copy and paste to text file. I'm affraid that my keyboard doesn't survive long ...
 
PHP:
<?
function code($limit)
	{
		return substr(md5(date("d.m.Y.H.i.s").rand(1,1000000000000000)) , 0 , $limit);
	}
$limit=rand(5,40);
echo code($limit);
?>
 
That method works but it will only include the characters
0 1 2 3 4 5 6 7 8 9 a b c d e f

I changed it so it contains characters from a user defined set

Code:
<?
  $charset="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  $clen=strlen($charset)-1;
function code($len)
{
 global $charset;
 global $clen;
 for ($str="",$n=0;$n<$len;$n++,$str.=substr($charset,mt_rand(0,$clen),1));
 return $str;
}

for ($n=0;$n<10;$n++)
{
 $limit=mt_rand(10,20);
 echo code($limit);
 echo "\n";
}
?>
replace the \n with <br> if you run it on a website
and replace 10,20 with the length (minimum maximum) of the strings

example output:
TyAP0iz6AuH
O47HuAqU1v3O
2g5cdouq5M2MWav4e
a5MZJoPXHLDoBI
xkKzqbRKzgOFfdPRPIS2
QCxa8C5Lm5CikDtdZ
XyntPT9KtdovYET
uFX3AWDQnMEaW1Kx
Z9qs6O6r146K5ayw
KeCwq4yDJ3g1Gqd
 
The WizGizmo Random String Creation Tool!​
5yztlk.jpg

ENJOY!​
 
google for "random string generator"

there are several websites that will do the trick. if that is what you are after..
 
Back
Top