Generatore di password

« Older   Newer »
  Share  
view post Posted on 22/4/2010, 18:15

Senior Member

Group:
Member
Posts:
27,291

Status:


SPOILER (click to view)
CODICE
<script language='javascript'>
<!-- Begin
function generate(form) {
var type=form.type.selectedIndex;
if (type<4) {
var selectionarray=new Array(62)
selectionarray[1]="A";
selectionarray[2]="B";
selectionarray[3]="C";
selectionarray[4]="D";
selectionarray[5]="E";
selectionarray[6]="F";
selectionarray[7]="G";
selectionarray[8]="H";
selectionarray[9]="I";
selectionarray[10]="J";
selectionarray[11]="K";
selectionarray[12]="L";
selectionarray[13]="M";
selectionarray[14]="N";
selectionarray[15]="O";
selectionarray[16]="P";
selectionarray[17]="Q";
selectionarray[18]="R";
selectionarray[19]="S";
selectionarray[20]="T";
selectionarray[21]="U";
selectionarray[22]="V";
selectionarray[23]="W";
selectionarray[24]="X";
selectionarray[25]="Y";
selectionarray[26]="Z";
selectionarray[27]="0";
selectionarray[28]="1";
selectionarray[29]="2";
selectionarray[30]="3";
selectionarray[31]="4";
selectionarray[32]="5";
selectionarray[33]="6";
selectionarray[34]="7";
selectionarray[35]="8";
selectionarray[36]="9";
selectionarray[37]="a";
selectionarray[38]="b";
selectionarray[39]="c";
selectionarray[40]="d";
selectionarray[41]="e";
selectionarray[42]="f";
selectionarray[43]="g";
selectionarray[44]="h";
selectionarray[45]="i";
selectionarray[46]="j";
selectionarray[47]="k";
selectionarray[48]="l";
selectionarray[49]="m";
selectionarray[50]="n";
selectionarray[51]="o";
selectionarray[52]="p";
selectionarray[53]="q";
selectionarray[54]="r";
selectionarray[55]="s";
selectionarray[56]="t";
selectionarray[57]="u";
selectionarray[58]="v";
selectionarray[59]="w";
selectionarray[60]="x";
selectionarray[61]="y";
selectionarray[62]="z";
var length=62;
 }
if (type<3) {
var selectionarray=new Array(36);
selectionarray[1]="a";
selectionarray[2]="b";
selectionarray[3]="c";
selectionarray[4]="d";
selectionarray[5]="e";
selectionarray[6]="f";
selectionarray[7]="g";
selectionarray[8]="h";
selectionarray[9]="i";
selectionarray[10]="j";
selectionarray[11]="k";
selectionarray[12]="l";
selectionarray[13]="m";
selectionarray[14]="n";
selectionarray[15]="o";
selectionarray[16]="p";
selectionarray[17]="q";
selectionarray[18]="r";
selectionarray[19]="s";
selectionarray[20]="t";
selectionarray[21]="u";
selectionarray[22]="v";
selectionarray[23]="w";
selectionarray[24]="x";
selectionarray[25]="y";
selectionarray[26]="z";
selectionarray[27]="0";
selectionarray[28]="1";
selectionarray[29]="2";
selectionarray[30]="3";
selectionarray[31]="4";
selectionarray[32]="5";
selectionarray[33]="6";
selectionarray[34]="7";
selectionarray[35]="8";
selectionarray[36]="9";
var length=36;
 }
if (type<2) {
var selectionarray=new Array(36);
selectionarray[1]="A";
selectionarray[2]="B";
selectionarray[3]="C";
selectionarray[4]="D";
selectionarray[5]="E";
selectionarray[6]="F";
selectionarray[7]="G";
selectionarray[8]="H";
selectionarray[9]="I";
selectionarray[10]="J";
selectionarray[11]="K";
selectionarray[12]="L";
selectionarray[13]="M";
selectionarray[14]="N";
selectionarray[15]="O";
selectionarray[16]="P";
selectionarray[17]="Q";
selectionarray[18]="R";
selectionarray[19]="S";
selectionarray[20]="T";
selectionarray[21]="U";
selectionarray[22]="V";
selectionarray[23]="W";
selectionarray[24]="X";
selectionarray[25]="Y";
selectionarray[26]="Z";
selectionarray[27]="0";
selectionarray[28]="1";
selectionarray[29]="2";
selectionarray[30]="3";
selectionarray[31]="4";
selectionarray[32]="5";
selectionarray[33]="6";
selectionarray[34]="7";
selectionarray[35]="8";
selectionarray[36]="9";
var length=36;
}
var lngth=form.length.selectedIndex;
var i,j;
var tmpstr;
tmpstr="";
i=0;
do {
{
var randscript = -1
while (randscript < 1 || randscript > length || isNaN(randscript))
{randscript = parseInt(Math.random()*(length))}
j=randscript}
tmpstr=tmpstr+selectionarray[j]
i=i+1}
while (i<lngth)
form.password.value = tmpstr;
}
//  End -->
</script>
 
Web  Top
0 replies since 22/4/2010, 18:15   17 views
  Share