view bin/pwgen @ 584:4130d41c6acb

Support for msys' USERNAME variable
author nanaya <me@myconan.net>
date Wed, 09 Mar 2016 15:37:53 +0900
parents fea77cdcdb09
children bdc9eddf3743
line wrap: on
line source

#!/usr/bin/env ruby

require 'securerandom'

length = ARGV[0].to_i
length = 12 if length <= 0
5.times do |n|
  puts "#{n}: #{SecureRandom.urlsafe_base64(length).slice(0, length)}"
end