Jump to content

Password Generator (In JavaScript)


Google™

Recommended Posts

Stop getting hacked! Use this JavaScript code to generate a random password unique to you.

 

var chars = "!@#$%^&*()0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var pass_length = prompt("How long do you want the pass to be?"); // set this to a specific number if you're not using JSFiddle or something like that
var randomstring = '';

for (let i = 0; i < pass_length; i++) {
	let rnum = Math.floor(Math.random() * chars.length);
	randomstring += chars.substring(rnum,rnum+1);
}

document.write(`${randomstring}`); // Used to see password if you're using JSFiddle
console.log(`${randomstring}`); // Puts out the randomly generated password to the console, use this if you're using CMD to run the code

 

Edited by Google™
Heidelberg likes this
Link to comment
On 12/24/2018 at 5:50 PM, Google™ said:

Stop getting hacked! Use this JavaScript code to generate a random password unique to you.

 


var chars = "!@#$%^&*()0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
var pass_length = prompt("How long do you want the pass to be?"); // set this to a specific number if you're not using JSFiddle or something like that
var randomstring = '';

for (let i = 0; i < pass_length; i++) {
	let rnum = Math.floor(Math.random() * chars.length);
	randomstring += chars.substring(rnum,rnum+1);
}

document.write(`${randomstring}`); // Used to see password if you're using JSFiddle
console.log(`${randomstring}`); // Puts out the randomly generated password to the console, use this if you're using CMD to run the code

 

FuCKnn     Aye DAt $Hittttt cooL AAsss FUK Brahhhh ThaNksss 4 Daa MeThodDddddd    

massi and Google™ like this
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...