238 | VBS | BigDinDonMan | 2018-11-21 13:47:07 | not approved |
Randomize(0)
dim s(95)
x = 0
i = 33
do while i < 128
s(x) = chr(i)
i = i + 1
x = x + 1
loop
res = ""
x = (256 - 8 + 1) * rnd() + 8
for i = 0 to x
res = res&cstr(s(rnd() * 95))
next
msgbox res
click to show comments
381 | Ruby | BigDinDonMan | 2018-11-21 13:25:43 | not approved |
s, _s = "", ""
i, j = 33, 128
while i < j do
s+=i.chr
i+=1
end
n, i = 8+rand(256 - 8), 0
while i < n do
_s+=s[rand(s.length)]
i+=1
end
print _s
click to show comments
31 | C# | BigDinDonMan | 2018-11-20 19:15:07 | not approved |
using System;
using System.Collections.Generic;
namespace Password {
class Program {
static void Main(string[] args) {
Random rand = new Random();
char[] chars = new char[127 - 33 + 1];
for (int i = 33, j = 0; i <= 127; ++i, chars[j] = (char)i, ++j);
int count = rand.Next(8, 257);
List<char> pass = new List<char>();
for (int i = 0; i < count; pass.Add(chars[rand.Next(0, chars.Length)]), ++i);
Console.WriteLine(new string(pass.ToArray()));
}
}
}
click to show comments
157 | Python | BigDinDonMan | 2018-11-20 18:56:58 | not approved |
from string import digits, ascii_letters, punctuation
from random import randint
chars = digits + ascii_letters + punctuation
amount = randint(8, 256)
password = [chars[randint(0, len(chars) - 1)] for i in range(amount)]
print("".join(password))
click to show comments