lib/strong_password/dictionary_adjuster.rb
# Returns the minimum entropy for the passwords dictionary adjustments.
# If a threshhold is specified we will bail early to avoid unnecessary
# processing.
# Note that we only check for the first matching word up to the threshhold if set.
# Subsequent matching words are not deductd.
Returns the minimum entropy for the passwords dictionary adjustments.
If a threshhold is specified we will bail early to avoid unnecessary
processing.
Note that we only check for the first matching word up to the threshhold if set.
Subsequent matching words are not deductd.
Returns the minimum entropy for the passwords dictionary adjustments . If a threshhold is specified we will bail early to avoid unnecessary processing . Note that we only check for the first matching word up to the threshhold if set . Subsequent matching words are not deductd .
def adjusted_entropy(password)
      base_password = password.downcase
      min_entropy = EntropyCalculator.calculate(base_password)
      PasswordVariants.all_variants(base_password).inject( min_entropy ) do |min_entropy, variant|
        [ min_entropy, EntropyCalculator.calculate( variant.sub( dictionary_words, '*' ) ) ].min 
      end
    end
def adjusted_entropy ( password ) base_password = password . downcase min_entropy = EntropyCalculator . calculate ( base_password ) PasswordVariants . all_variants ( base_password ) . inject ( min_entropy ) do | min_entropy , variant | [ min_entropy , EntropyCalculator . calculate ( variant . sub ( dictionary_words , '*' ) ) ] . min end end
Returns the minimum entropy for the passwords dictionary adjustments.
Returns the minimum entropy for the passwords dictionary adjustments .
# Process the passwords, while looking for possible matching words in the dictionary.
password
<not_specific>