Computing.Net > Forums > Web Development > online password generator

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

online password generator

Reply to Message Icon

Name: olidav911
Date: November 16, 2006 at 06:12:13 Pacific
OS: N/A
CPU/Ram: N/A
Product: N/A
Comment:

I would like to create a password generator using javascript or something but how do I do this because I want to create a password that is 6 digits long, and it needs to be 3 letters followed by three number, i.e "abc123". Any help would be greatly appreciated!



Sponsored Link
Ads by Google

Response Number 1
Name: Michael J (by mjdamato)
Date: November 16, 2006 at 10:44:57 Pacific
Reply:

Do you want upper and lowercase letter or just one of them?

Michael J


0

Response Number 2
Name: Michael J (by mjdamato)
Date: November 16, 2006 at 11:00:00 Pacific
Reply:

Upper case letters only:

function generatePassword() {

a1 = Math.floor(Math.random()*26+65);
a2 = Math.floor(Math.random()*26+65);
a3 = Math.floor(Math.random()*26+65);
n1 = Math.floor(Math.random()*10+48);
n2 = Math.floor(Math.random()*10+48);
n3 = Math.floor(Math.random()*10+48);

password = String.fromCharCode(a1,a2,a3,n1,n2,n3);
return password;
}


Lower case letters only:

function generatePassword() {

a1 = Math.floor(Math.random()*26+97);
a2 = Math.floor(Math.random()*26+97);
a3 = Math.floor(Math.random()*26+97);
n1 = Math.floor(Math.random()*10+48);
n2 = Math.floor(Math.random()*10+48);
n3 = Math.floor(Math.random()*10+48);

password = String.fromCharCode(a1,a2,a3,n1,n2,n3);
return password;
}


Upper and lower case letters:

function generatePassword() {

a1 = Math.floor(Math.random()*52+65);
a1 = (a1 > 90) ? a1 + 6 : a1;
a2 = Math.floor(Math.random()*52+65);
a2 = (a2 > 90) ? a2 + 6 : a2;
a3 = Math.floor(Math.random()*52+65);
a3 = (a3 > 90) ? a3 + 6 : a3;
n1 = Math.floor(Math.random()*10+48);
n2 = Math.floor(Math.random()*10+48);
n3 = Math.floor(Math.random()*10+48);

password = String.fromCharCode(a1,a2,a3,n1,n2,n3);
return password;
}

Michael J


0

Response Number 3
Name: olidav911
Date: November 20, 2006 at 07:01:37 Pacific
Reply:

Thanks a lot. It was only the lowercase one that I wanted but your help is very much appreciated.


0

Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More


setting up IIS Javascript form



Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Web Development Forum Home


Sponsored links

Ads by Google


Results for: online password generator

Securing a Web Page with a password www.computing.net/answers/webdevel/securing-a-web-page-with-a-password/1079.html

password site and export log file www.computing.net/answers/webdevel/password-site-and-export-log-file/1415.html

Whos Online www.computing.net/answers/webdevel/whos-online/1535.html