Skip to content

Commit 0a96826

Browse files
authoredNov 18, 2020
Create Password.jl
Initial
1 parent 7491e4f commit 0a96826

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
 

‎Password.jl

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
#Password.jl
2+
3+
#Generate a random password
4+
5+
6+
7+
len=16
8+
9+
fullChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz,.;':[]{}|1234657890-=_+!@#\$%^&**()"
10+
11+
fewChars="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz1234657890=!-@_*."
12+
13+
14+
15+
function randomPassword(chars=fewChars)
16+
17+
numChars=length(chars)
18+
19+
p=""
20+
21+
for i in 1:len
22+
23+
# global p
24+
25+
c=rand(1:numChars)
26+
27+
p=p*chars[c]
28+
29+
end
30+
31+
return p
32+
33+
end
34+
35+
36+
37+
println(randomPassword())

0 commit comments

Comments
 (0)
Please sign in to comment.