генератор посложнее

Jun 26, 2013 15:46

23+8n410-e6%;O744JW48X8Z
Ubs=3&;0=8g25B4N^033)one
0%+4377(Fm-R+608&12+FH19
$-LyZ60Ih22^*G47iV7ov12H
$TdHJeQGQ+2w!^2s@3Pl4RhL
2c9!hZ-61=$9204R@$Zr6;K^

def let= 'a'..'z'
def dig = '0123456789'
def sym = '!@$%^&*()_-=+:;'

all = [let, sym, dig]

def random = new Random()

def next = { arr ->
arr[random.nextInt(arr.size())]
}

def generate = {

def pwd = []

(0..23).each {
def n = next(next(all))
if(random.nextBoolean())
n = n.toUpperCase()
pwd << n
}

println pwd.join()
}

(0..5).each { generate() }
Previous post Next post
Up