Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int password_length = 12
- if (args.size() > 0) {
- password_length = args[0] as int
- }
- String validChars ="qwertyuiopasdfghjklzxcvbnm1234567890QWERTYUIOPASDFGHJKLZXCVBNM"
- int maxIndex = validChars.length()
- def rnd = new Random()
- def password = (1..password_length).sum {
- validChars[rnd.nextInt(maxIndex)]
- }
- println(password)
Add Comment
Please, Sign In to add comment