View file passgen.html

File size: 6.58Kb
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru">
<head>
<script src="js/config.js" type="text/javascript"></script>
<link rel="stylesheet" type="text/css" href="style.css"/>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"/>
<meta http-equiv="Content-Type" content="application/vnd.wap.xhtml+xml; charset=UTF-8"/>
<title>Xmoder.wen.ru</title>
</head>

<body>


<div class="menu">&not;Генератор паролей</div>
<div class="b">
<table width="100%" border=0 title="Генератор паролей"><tr><td>
<script language="JavaScript1.2">
with (document) {
	writeln('</head><form name=myform>' +
	'<table><tr><td><b>Какие символы использовать в пароле?</b></td></tr>' +
	'<tr><td><input OnClick=OnCheck(0) class=chk name=upper type=checkbox value=0>&nbsp;Заглавные буквы [A]</td></tr>' +
	'<tr><td><input OnClick=OnCheck(0) class=chk name=lower type=checkbox value=1>&nbsp;Маленькие буквы [a]</td></tr>' +
	'<tr><td><input OnClick=OnCheck(0) class=chk name=speci type=checkbox value=0>&nbsp;Спецсимволы [!]</td></tr>' +
	'<tr><td><input OnClick=OnCheck(0) class=chk name=digit type=checkbox value=2>&nbsp;Цифры [0]</td></tr>' +
	'<tr><td>&nbsp;По шаблону&nbsp;' +
	'<input OnClick=OnCheck(1) name=gettempl size=10 maxlength=20 type=text value=""></td></tr>' +
	'<tr><td>Длина пароля:&nbsp;' +
	'<select name=numbers>');
	for (j = 4; j <= 19; j++) { writeln('<option value=' + j + ((j==10)?' selected':'')+'>' + j + '</option>'); }
	writeln('</select></td></tr>' +
	'<tr><td style="padding-top:10"><input type=button value=Сгенерировать onClick=generate()><br><br>&nbsp;<B>Ваш пароль:</B><BR>' +
	'</td></tr><table>');
	for(j=0;j<10;j++)
	{
		ne = 'gb'+j;
		writeln('<tr><td><input name='+ne+' size=25 maxlength=30 type=text value=""></td></tr>');
	}
	writeln('</table></form>');
}
// массивы символов
upp = new Array('','A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z');
low = new Array('','a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z');
dig = new Array('','0','1','2','3','4','5','6','7','8','9');
spe = new Array('','~','@','#','$','%','&','*','+','=','!');
// ------------------------------------------------------------------------------
function ccl(a){window.clipboardData.setData('text', eval('document.myform.gb'+a+'.value'));}
// -----------------------------------------f------------------------------------
function OnCheck(b)
{
    if(b)
    {
        document.myform.upper.checked=0;
        document.myform.lower.checked=0;
        document.myform.digit.checked=0;
        document.myform.speci.checked=0;
        }else
        document.myform.gettempl.value = '';
}
// --------------------------------------------------------------------------------------------------------------------------------------------------------------
function rnd(x,y,z) {
	var num;
	do {
		num = parseInt(Math.random()*z);
		if (num >= x && num <= y) break;
	} while (true);
return(num);
}
// --------------------------------------------------------------------------------------------------------------------------------------------------------------
function genArray() {
	var pwd = '';
	var res, s;
	var k = 0;
	var n = document.myform.numbers.value;
    var tn = document.myform.gettempl.value;
    if (myform.gettempl.value.length>0)
        n = tn.length;
	var pass = new Array();
	var w = rnd(30,80,100);
    if (tn.length>0)
    {
        for(var r = 0; r<tn.length; r++)
        {
            i = tn.substr(r,1);
            switch(i)
            {
                case 'A':
                    res = rnd(1,26,100);
                    pwd += upp[res];
                    break;
                case 'a':
                    res = rnd(1,26,100);
                    pwd += low[res];
                    break;
                case '!':
                    res = rnd(1,10,100);
                    pwd += spe[res];
                    break;
                case '0':
                    res = rnd(1,10,100);
                    pwd += dig[res];
                    break;
                default:
                    pwd += i;
            }
        }
    }else
    {
	for (var r = 0; r < w; r++) {
		if (myform.upper.checked) { res = rnd(1,26,100); pass[k] = upp[res]; k++; }
		if (myform.lower.checked) { res = rnd(1,26,100); pass[k] = low[res]; k++; }
		if (myform.digit.checked) { res = rnd(1,10,100); pass[k] = dig[res]; k++; }
		if (myform.speci.checked) { res = rnd(1,10,100); pass[k] = spe[res]; k++; }
	}
	for (var i = 0; i < n; i++) {
		s = rnd(1,k-1,100);
		pwd+= pass[s];
	}
    }
	return pwd;
}
// --------------------------------------------------------------------------------------------------------------------------------------------------------------
function generate() {
	if ((myform.upper.checked || myform.lower.checked || myform.speci.checked || myform.digit.checked) ||
        (myform.gettempl.value.length>0))
	{ for(i=0;i<10;i++){eval('document.myform.gb'+i+'.value=genArray()');} }
	else { alert('Для особо одаренных: выберите символы, из которых будет состоять пароль!'); myform.upper.checked = true; }
}
</script>
</table></center>
<br>
<center>
<hr noshade size="1">
<p center style="margin-top:-4px;">Based <a href="http://morpfey.r2.ru/">[HNC]</a> Edited by <a href="mailto:[email protected]">RefuZZer</a><br>Encoded by <a href="mailto:[email protected]">EvolVER</a></p>
</CENTER>
<!--------------------------->


</div>
</div>
</div>
<div align="center"><div class="menu">Реклама</div>
<div class="cont">
<div align="center"><script src="js/reklhead.js" type="text/javascript"></script>
</div>
</div>
</div>
<div class="foot">

&copy; <script src="js/imyasaita.js" type="text/javascript"></script><br/>

<!-- Ссылку убирать вам ни кто ни заприщает, но увожайте труд разробочика -->Mod by <a href="http://xmoder.wen.ru">Xmoder.wen.ru</a><br/>

</div>
<div class="counts">

Счётчики/Баннеры</br>
<script src="js/counter.js" type="text/javascript"></script>
<script language="JavaScript" src="http://free-one.ru/xml_gzip_status.php"></script>
</div>
</body>
</html>