javascript 16位 密码生成器 keymaker 16bit
工作中经常需要生成16位强密码给应用授权。以前在windows环境下使用keypass,目前公司不允许使用windows操作系统,特意写了一个生成器。[html]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>16bit keymake</title>
<script type="text/javascript">
var rnd={};
rnd.size=16;
rnd.list=['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','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','0','1','2','3','4','5','6','7','8','9'];
rnd.val=''; www.zzzyk.com
for(var i=0;i<rnd.size;++i){
var tmp = parseInt((rnd.list.length)*Math.random());
if(i==7){
if(tmp%2 == 0){
rnd.val+='_';
}else{
rnd.val+=rnd.list[tmp]+'_';
rnd.list.splice(tmp,1);
i++;
}
}else{ www.zzzyk.com
//document.write("<br />"+rnd.list.length+" == "+tmp);
rnd.val+=rnd.list[tmp];
rnd.list.splice(tmp,1);
}
}
document.write("<br />"+rnd.val);
//document.write("<br />"+rnd.list.length);
</script>
</head>
<body>
</body>
</html>
补充:web前端 , JavaScript ,