Class: GentleBrute::BruteForcer
- Inherits:
-
Object
- Object
- GentleBrute::BruteForcer
- Defined in:
- lib/gentle_brute.rb
Instance Method Summary collapse
-
#initialize(start_length = 1, cpa_threshold = 24) ⇒ BruteForcer
constructor
A new instance of BruteForcer.
-
#next_valid_phrase ⇒ String
The next English-like brute force phrase.
Constructor Details
#initialize(start_length = 1, cpa_threshold = 24) ⇒ BruteForcer
Returns a new instance of BruteForcer.
16 17 18 19 |
# File 'lib/gentle_brute.rb', line 16 def initialize(start_length=1, cpa_threshold=24) @odometer = Odometer.new start_length @word_analyzer = WordAnalyzer.new cpa_threshold end |
Instance Method Details
#next_valid_phrase ⇒ String
Returns the next English-like brute force phrase.
22 23 24 25 26 27 28 |
# File 'lib/gentle_brute.rb', line 22 def next_valid_phrase while true @odometer.increment phrase = @odometer.string_for_odometer return phrase if @word_analyzer.is_valid_word? phrase end end |