Groovy web console

subscribe to the feed Subscribe
to this
site
Password Gen (via #groovywebconsole)
tweet this snippet Tweet
this
script

Password Gen

Published 6 months ago by Kieran Smith with tags Password Generator
Actions  ➤ Edit in console Back to console Show/hide line numbers View recent scripts

def allChars = [ 'A'..'Z', 'a'..'z', '0'..'9' ].flatten() 
 
def generatePassword = { length ->
(0..<length).collect { allChars[ new Random().nextInt( allChars.size() ) ] }.join()
}  

10.times {
println generatePassword(80)
}