Random Password Generator

Size
4,286 Kb
Views
12,144

How do I make an random password generator?

A random password generator that will make alpha-numeric, hexadecimal, or ASCII passwords of lengths 4, 6, 8, 10, 12, 14, and 16 chars long. You can then use a button to copy your password securely to the clipboard. . What is a random password generator? How do you make a random password generator? This script and codes were developed by Joshua Michael Waggoner on 11 October 2022, Tuesday.

Random Password Generator Previews

Random Password Generator - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Random Password Generator</title> <link href='https://fonts.googleapis.com/css?family=Lato|Oswald' rel='stylesheet' type='text/css'>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="viewport" content="width=device-width, initial-scale=1"> <link rel='stylesheet prefetch' href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <div class='header'> <h1><span class='noselect'> > <span class='blinker'>_</span> </span> Random Password Generator</h1>
</div>
<select class='btn btn-default pw-select'> <option val='0' selected disabled>Select password type</option> <option val='alpha'>Alpha Numeric</option> <option val='ascii'>ASCII</option> <option val='hex'>Hexadecimal</option>
</select>
<select class='btn btn-default pw-len'> <option val='0' selected disabled>Select length</option> <option val='4'>4-chars</option> <option val='6'>6 chars</option> <option val='8'>8 chars</option> <option val='10'>10 chars</option> <option val='12'>12 chars</option> <option val='14'>14 chars</option> <option val='16'>16 chars</option>
</select>
<button class=' btn btn-success submit'> Generate
</button>
<h2 class='pw'> <div class='password'>password</div>
</h2>
<button class='btn btn-danger clip'> Copy To Clipboard
</button> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Random Password Generator - Script Codes CSS Codes

body { text-align: center;
}
.header { font-family: 'Oswald';
}
.blinker { animation-name: blinker; animation-iteration-count: infinite; animation-duration: 1s; display: inline-block;
}
body { background-color: #333; color: white;
}
h1 { text-transform: uppercase; margin: 20px;
}
select, button { font-family: 'Lato';
}
.pw { letter-spacing: .4em; font-family: monospace; maring-bottom: 30px;
}
@keyframes blinker { from { opacity: 1.0; } to { opacity: 0.0; }
}

Random Password Generator - Script Codes JS Codes

(function() { var charset, charset_alpha, charset_hex, copy, generateAsciiPwd, generatePwd, len, pwType; pwType = null; len = null; charset = null; charset_alpha = 'abcdefghijklnopqrstuvwxyz' + 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' + '0123456789'; charset_hex = '0123456789ABCDEF'; $('.pw-select').on('click', function() { pwType = $(".pw-select option:selected").attr('val'); }); $('.pw-len').on('click', function() { len = $(".pw-len option:selected").attr('val'); }); $('.submit').click(function() { if (pwType === 'alpha') { charset = charset_alpha; generatePwd(len); } if (pwType === 'hex') { charset = charset_hex; generatePwd(len); } if (pwType === 'ascii') { generateAsciiPwd(len); } }); $('.clip').on('click', function() { copy($('.password').text()); }); /* * Generate an alpha numeric or hex pw */ generatePwd = function(length) { var i, n, retVal; retVal = ''; i = 0; n = charset.length; while (i < length) { retVal += charset.charAt(Math.floor(Math.random() * n)); ++i; } if (retVal !== '') { return $('.password').text(retVal); } }; /* * Generate an ascii pw */ generateAsciiPwd = function(length) { var i, n, offset, random, retVal; retVal = ''; i = 0; offset = 33; n = 92; while (i < length) { random = Math.floor(Math.random() * n); retVal += String.fromCharCode(random + offset); ++i; } if (retVal !== '') { return $('.password').text(retVal); } }; /* * Copies the password to an alert so that * the user can copy it. This is the most * secure way I can think to do it. */ copy = function(text) { window.prompt('Copy to clipboard: Ctrl+C, Enter', text); }; $('.prompt').css('animation', 'blinker 1.5s ease-in-out infinite');
}).call(this);
Random Password Generator - Script Codes
Random Password Generator - Script Codes
Home Page Home
Developer Joshua Michael Waggoner
Username rabbitfighter81
Uploaded October 11, 2022
Rating 3
Size 4,286 Kb
Views 12,144
Do you need developer help for Random Password Generator?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Joshua Michael Waggoner (rabbitfighter81) Script Codes
Create amazing video scripts with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!