<script language="javascript1.1">
<!--
// Script by Joseph K. Myers <e_mayilme@hotmail.com>, <https://www.angelfire.com/yt/jmyers/>.
// This script produces a password with a length equal to the argument passed to createPassword().
// The chances of "guessing" a password of eight characters are 1 in 3,521,614,606,208.
// Use this formula 62! / (62 - ( argument of createPassword() )!.
// i.e. createPassword(3) level of strength = 62 times 62 times 62.
var textString = 'abcdefghijklmnopqrstuvwxyz0123456789';
function createPassword(argLen) {
if (!argLen || argLen > 1000 || argLen < 1 || isNaN(argLen)) {
alert('Error of type -362 occurred.\n\nArgument '+ unescape("%D2argLen%D3") + " given invalid radii.");
return (isNaN(argLen)) ? 'non-numeric argument' : 'bad numeric identity';
}
var aHardThing = '';
while (aHardThing.length < argLen) {
var randChar = textString.charAt( Math.floor(Math.random() * textString.length) );
aHardThing += (Math.random() < .5) ? randChar.toUpperCase() : randChar;
} return aHardThing;
}
//-->
</script>
|