MDT Password Strength AngularJs directive that validates password and evaluates its strength

Installation

npm i mdt-password-strength

or

npm i --save mdt-password-strength

Usage

Demo https://adam-bubela.github.io/mdt-password-strength/demo

html <input ng-model="password" name="password" type="password" required mdt-password-strength mdt-feedback="validationResult_material" mdt-strength-levels='{"weak":[6,1,0,0,0],"fine":[8,2,1,1,0],"good":[9,2,2,2,1]}'/>

Attribute `mdt-strength-levels` requires 2-dimensional array

{
   "weak":[6,1,0,0,0], // 6 characters long, 1 uppercase
   "fine":[8,2,1,1,0], // 8 characters long, 2 uppercase,  1 lowercase,  1 digit
   "good":[9,2,2,2,1]  // 9 characters long, 2 uppercases, 2 lowercases, 2 digits, 1 special character
}

The password is valid when at least the first ('weak' in the above example) set of conditions is met. The mdt-feedback returns the password strength level. In the given example it would be `weak`, `fine`, `good` or false if the password is completely invalid.

There must be at least 1 validation level which may be identified by any array key, however each level must always have 5 integer possitive values which stand for the following minimum requirements: