MCPcopy Create free account
hub / github.com/codemistic/Web-Development / generatePassword

Function generatePassword

Password Generator/index.js:6–21  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4// console.log(passLength.value)
5
6function generatePassword(){
7 var chars = "0123456789abcdefghijklmnopqrstuvwxyz!@#$%^&*()ABCDEFGHIJKLMNOPQRSTUVWXYZ";
8 // var passwordLength = 12;
9
10
11 passwordLength = passLength.value
12
13 var password = ""
14
15 for(var i=0; i<=passwordLength; i++){
16 var randomNumber = Math.floor(Math.random() * chars.length)
17 // password += chars.substring(randomNumber, randomNumber + 1)
18 password += chars.charAt(randomNumber)
19 }
20 document.getElementById("password").value = password;
21}
22
23function copyPassword() {
24 var copyText = document.getElementById('password')

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected