Module: EasyPasswords
- Defined in:
- lib/easy_passwords/wordlist.rb,
lib/easy_passwords/version.rb,
lib/easy_passwords/easy_passwords.rb
Overview
Public: EasyPasswords is a Ruby implementation of passwdqc’s easy_passwords password generator.
Examples
EasyPasswords.generate
# => "merger*Hick$"
EasyPasswords.new.generate
# => "employ7Royal"
EasyPasswords::Generator.new.generate # => “Beige7Jacob2”
EasyPasswords::Generator.new.generate 4 # => “min5”
Defined Under Namespace
Classes: Generator
Constant Summary collapse
- VERSION =
"0.1"
- DEFAULT_MAX_LENGTH =
12
- MIN_WORD_LENGTH =
3
- MAX_WORD_LENGTH =
6
Class Method Summary collapse
-
.generate(max_length = DEFAULT_MAX_LENGTH) ⇒ Object
Public: Returns a random generated password string.
- .new ⇒ Object
Class Method Details
.generate(max_length = DEFAULT_MAX_LENGTH) ⇒ Object
Public: Returns a random generated password string.
max_length - max number of characters used in password, it could generate password shorter by 3 characters.
Example
generate 8 # => “Fun=Crop”
generate # => “spate7Coup”
Returns a password string.
40 41 42 |
# File 'lib/easy_passwords/easy_passwords.rb', line 40 def self.generate(max_length = DEFAULT_MAX_LENGTH) self::Generator.new.generate max_length end |
.new ⇒ Object
44 45 46 |
# File 'lib/easy_passwords/easy_passwords.rb', line 44 def self.new self::Generator.new end |