def generate(number_of_words: 4, separator: ' ')
      attempts = 0

      loop do
        words = Array.new(number_of_words) do
          RFC1751_WORDS[SecureRandom.random_number(RFC1751_WORDS.length)].downcase
        end

        phrase = words.join(separator)
        return phrase if valid?(phrase)

        attempts += 1
        raise 'Failed to generate a #valid? password!' if attempts > 10
      end
    end
def generate(number_of_words: 4, separator: ' ')
      attempts = 0

      loop do
        words = Array.new(number_of_words) do
          RFC1751_WORDS[SecureRandom.random_number(RFC1751_WORDS.length)].downcase
        end

        phrase = words.join(separator)
        return phrase if valid?(phrase)

        attempts += 1
        raise 'Failed to generate a #valid? password!' if attempts > 10
      end
    end
Generates a random #valid? password, using the 2048-word RFC1751 dictionary.
 Optionally, specify `number_of_words` and/or `separator`.

   NdrSupport::Password.generate #=> "sill quod okay phi"
   NdrSupport::Password.generate #=> "dint dale pew wane"
   NdrSupport::Password.generate #=> "rent jude ding gent"

   NdrSupport::Password.generate(number_of_words: 6) #=> "dad bide thee glen road beam"

   NdrSupport::Password.generate(separator: '-') #=> "jail-net-skim-cup"

 Raises a RuntimeError if a strong enough password was not produced:

   NdrSupport::Password.generate(number_of_words: 1) #=>
     RuntimeError: Failed to generate a #valid? password!