Mercurial > ec-dotfiles
comparison bin/pwgen @ 495:fea77cdcdb09
Size-customizable pwgen.
author | edogawaconan <me@myconan.net> |
---|---|
date | Fri, 20 Dec 2013 20:17:00 +0900 |
parents | 8956a404dba6 |
children | bdc9eddf3743 |
comparison
equal
deleted
inserted
replaced
494:229acf12b960 | 495:fea77cdcdb09 |
---|---|
1 #!/usr/bin/env ruby | 1 #!/usr/bin/env ruby |
2 | 2 |
3 require 'securerandom' | 3 require 'securerandom' |
4 | 4 |
5 length = ARGV[0].to_i | |
6 length = 12 if length <= 0 | |
5 5.times do |n| | 7 5.times do |n| |
6 puts "#{n}: #{SecureRandom.urlsafe_base64(12)}" | 8 puts "#{n}: #{SecureRandom.urlsafe_base64(length).slice(0, length)}" |
7 end | 9 end |