repl.it
@PacoTaco/

password gen

Nodejs

No description

fork
loading
Files
  • index.js
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
firstDigit = Math.floor(Math.random() * 9);
secDigit = Math.floor(Math.random() * 9);
thirdDigit = Math.floor(Math.random() * 9);

fourthDigit = Math.floor(Math.random() * 9);


correctPin = String(firstDigit) + String(secDigit) + String(thirdDigit) +String(fourthDigit)

function login(pin){
  if(pin == correctPin){
    console.log("youre in")
  }
  
}



for(i = 0; i <= 9999; i++){
   if (i > 0 && i <10){
    i = String(i)
    i = "000" + i
   }
   if (i > 10 && i < 100){
    i = String(i)
    i = "00"+ i
   }
   if (i > 100 && i < 1000 ){
    i = String(i)
    i= "0" + 1
   }
  login(i)

}
  

Fetching token
?