As an easy and quick to use alternative to the Excel random password generator , I’ve made this online Javascript adaptation of the random password generation function code… You can watch its source code below…
Characters
Uppercase Lowercase Numbers
Random Password
The code is licensed under the GNU GPL v3 …
Just in case you want to see the function code without looking into the source code:
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
function
RandomPassword(Length, Upper, Numbers, Lower)
{
Upper =
typeof
(Upper) !=
'undefined'
? Upper :
true
;
Numbers =
typeof
(Numbers) !=
'undefined'
? Numbers :
true
;
Lower =
typeof
(Lower) !=
'undefined'
? Lower :
true
;
if
(!Upper && !Lower && !Numbers)
return
""
;
var
Ret =
""
;
var
Num;
var
Repeat;
Chars = 26 * 2 + 10;
for
(i = 1; i <= Length; i++)
{
Repeat =
false
;
Num = Math.floor(Math.random()*Chars);
if
(Num < 26)
if
(Lower)
Ret = Ret + String.fromCharCode(Num + 97);
else
Repeat =
true
;
else
if
(Num < 52)
if
(Upper)
Ret = Ret + String.fromCharCode(Num - 26 + 65);
else
Repeat =
true
;
else
if
(Num < 62)
if
(Numbers)
Ret = Ret + String.fromCharCode(Num - 52 + 48);
else
Repeat =
true
;
if
(Repeat)
i--;
}
return
Ret;
}
Incoming search terms for the article:
Recent Comments