Module: Pwm
- Defined in:
- lib/pwm.rb,
lib/pwm/version.rb
Constant Summary collapse
- VERSION =
"1.0.2"
Class Method Summary collapse
Class Method Details
.characters ⇒ Object
4 5 6 |
# File 'lib/pwm.rb', line 4 def self.characters (('A'..'Z').to_a + ('a'..'z').to_a + ('2'..'9').to_a) - ['I', 'O', 'l'] end |
.password(length = 16) ⇒ Object
8 9 10 11 12 |
# File 'lib/pwm.rb', line 8 def self.password(length=16) (0..length-1).inject('') do |pw, n| pw + characters[rand(characters.length)] end end |