Skip to content

adam-bubela/mdt-password-strength

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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 ```

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:

  • password length
  • number of uppercase characters `ABCDEFGHIJKLMNOPQRSTUVWXYZ`
  • number of lowercase characters `abcdefghijklmnopqrstuvwxyz`
  • number of digits `0-9`
  • mumber of special characters `_+-.,!@#$%^&*();\/|<>"'`

About

Angular directive that validates password and evaluates its strength

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published