1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<title>Password Generator</title>
<style type="text/css">
body, html {
height:100%;
width:100%;
overflow:hidden;
}
body{
background-color: #8FB480;
color: #025D02;}
#cont {
width:450px;
margin:20px auto;
border: solid 2px #194308;
height:auto;
overflow:hidden;
}
.label {width : 150px;
float:left;
padding:5px 0 15px 15px;
}
.label, h3 { font-family:verdana;
}
.field {
width: 100%;
background-color: #9EEE91 ;
padding : 5px 0;
float:left;
}
#lon {
width:30px;
text-align:right;
}
#res {
width:250px;
font-family:consolas,dina,arial ;
font-size:15px;
text-align:center;
letter-spacing: 2px;}
.last,h3 {text-align:center;}
</style>
<script type="text/javascript">
//<![CDATA[
/******************************
* SpaceFrog 03.05.2010 *
* generateur de mots de passe *
*******************************/
cons="bcdfghklmnprstvwxz".split('')
cons=cons.concat(new Array('ss','tt','ll','nn','mm','pp','ch','qu','gg','cc'))
var voys=new Array('a','e','i','o','u','ai','au','ou','ei','ui','ey','oi')
var compo=new Array(voys, cons)
var BaseL= new Array(voys.length,cons.length)
function generate(){
var lon=''+document.getElementById('lon').value
var rep=new Array();
var myrand =new Date().getMilliseconds();
debut=(myrand % 2) == 0
while(--lon > -1){
lot=(debut)?0:1;
debut= !debut
rep.push( compo[lot][ Math.floor(Math.random()*BaseL[lot])])
}
document.getElementById('res').value=rep.join('').replace(/^(\D)\1/,'$1').replace(/(\D)\1$/,'$1').replace(/([aeiouy])\1/,'$1')
}
//]]>
</script>
</head>
<body>
<div id="cont">
<div class="field"><h3>SpaceFrog's password generator</h3></div>
<div class="field"><span class="label">Longueur :</span><input type='text' id='lon' value='6' maxLength='2'/></div>
<div class="field"><span class="label">Mot de passe:</span><input type='text' id='res' value='' readonly="readonly" /></div>
<div class="last field"><input type="button" onclick="generate()" value = "generation" /></div>
</div>
</body>
</html> |
Partager