Post by Jay on Sept 5, 2005 12:41:21 GMT -8
Preview: click here
Placement: anywhere you like.
Compatability: PBv4 / Crossbrowser
Notes: Can be placed anywhere you like on your forum, preferrably at the footer. Passwords can be generated at 4 different strengths, each including uppercase, lowercase, numbers, and special characters. I recommend using atleast a 10 character password mixed with all four combinations.
<script type="text/javascript">
<!--
// Random Password Generator v2
// Open source
var allPassChars = '';
allPassChars += '9876543210'; // number generation
allPassChars += 'aBcDeFgHiJkLmNoPqRsTuVwXyZ'; // upper/lowercase generation
allPassChars += '~!@#$%^&*()_+\{\}\\\[\]><?'; // special character generation
function doRanPass(len) {
var pass = '';
var passInp = document.getElementById('passinp');
if (len != parseInt(len) || !len.match(/[\d.]/)) {
return passInp.value = 'Please select strength.';
}
else if (len == parseInt(len)) {
for (var i = parseInt(len - 1); i >= 0; i--) {
pass += allPassChars.charAt(Math.floor(Math.random() * (allPassChars.length - 1)));
}
return passInp.value = pass.replace(/\s/g, '');
}
}
with (document) {
write('<div align="center" style="font-size: 10px;"><b>Password Generator</b><br />');
write('<input id="passinp" type="text" size="24" onfocus="this.select();" value="">');
write('&' + 'nbsp;<select name="passsel"><option value="str">Strength:</option><option value="5">5</option>');
write('<option value="10">10</option><option value="15">15</option><option value="20">20</option></select>');
write('<input type="button" value="Go" onclick="doRanPass(this.previousSibling.options[this.previousSibling.options.selectedIndex].value);">');
write('</div>');
}
//-->
</script>
Placement: anywhere you like.
Compatability: PBv4 / Crossbrowser
Notes: Can be placed anywhere you like on your forum, preferrably at the footer. Passwords can be generated at 4 different strengths, each including uppercase, lowercase, numbers, and special characters. I recommend using atleast a 10 character password mixed with all four combinations.
<script type="text/javascript">
<!--
// Random Password Generator v2
// Open source
var allPassChars = '';
allPassChars += '9876543210'; // number generation
allPassChars += 'aBcDeFgHiJkLmNoPqRsTuVwXyZ'; // upper/lowercase generation
allPassChars += '~!@#$%^&*()_+\{\}\\\[\]><?'; // special character generation
function doRanPass(len) {
var pass = '';
var passInp = document.getElementById('passinp');
if (len != parseInt(len) || !len.match(/[\d.]/)) {
return passInp.value = 'Please select strength.';
}
else if (len == parseInt(len)) {
for (var i = parseInt(len - 1); i >= 0; i--) {
pass += allPassChars.charAt(Math.floor(Math.random() * (allPassChars.length - 1)));
}
return passInp.value = pass.replace(/\s/g, '');
}
}
with (document) {
write('<div align="center" style="font-size: 10px;"><b>Password Generator</b><br />');
write('<input id="passinp" type="text" size="24" onfocus="this.select();" value="">');
write('&' + 'nbsp;<select name="passsel"><option value="str">Strength:</option><option value="5">5</option>');
write('<option value="10">10</option><option value="15">15</option><option value="20">20</option></select>');
write('<input type="button" value="Go" onclick="doRanPass(this.previousSibling.options[this.previousSibling.options.selectedIndex].value);">');
write('</div>');
}
//-->
</script>