PasswordsGenerator
Enjoy using 😎
About
Generate human readable and easy to remember passwords
Installation
gem build passwords_generator.gemspec
gem install passwords_generator-0.5.0.gem
Usage
irb(main):001:0> require 'passwords_generator'
=> true
> PasswordGenerator.new.generate
=> "SYstdepo"
Options
-
Password length
default: 8
> PasswordGenerator.new(length: 3).generate
=> "AWy"
> PasswordGenerator.new(length: 20).generate
=> "socieprIncommedozEn1"
-
Skip upper case
default: false
> PasswordGenerator.new(skip_upper_case: true).generate
=> "electrhu"
-
Without word
default: false
> PasswordGenerator.new(without_word: true).generate
=> "oFoKusar"
-
Skip number
default: false
> PasswordGenerator.new(skip_number: true).generate
=> "JamYgrep"
-
Count upper case
default: 2
> PasswordGenerator.new(count_upper_case: 5).generate
=> "DRIveCOn"
-
Custom dictionary
default: nil
If you want to use your dictionary to generate passwords, pass the path to the text file to the gem.
words must be separated by spaces
sample.txt
Lorem ipsum dolor sit amet, consectetur adipiscing elit,
sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut
enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi
ut aliquip ex ea commodo consequat. Duis aute irure dolor in
reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
culpa qui officia deserunt mollit anim id est laborum.
> PasswordGenerator.new(custom_dictionary_file: 'sample.txt').generate
=> "LorEMcil"
Use many options at once!
> PasswordGenerator.new(length: 5, skip_upper_case: true).generate
=> "obopy"
> PasswordGenerator.new(length: 10, without_word: true, count_upper_case: 9).generate
=> "AXIMORUSEp"
> PasswordGenerator.new(custom_dictionary_file: 'sample.txt', skip_upper_case: true, length: 10, ).generate
=> "ullaad54mo"
Default settings
skip_upper_case: false,
without_word: false,
skip_number: false,
length: 8,
count_upper_case: 2,
custom_dictionary_file: nil