# ng-password-strength **Repository Path**: mirrors_linslin/ng-password-strength ## Basic Information - **Project Name**: ng-password-strength - **Description**: Password strength directive for angular - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2020-08-09 - **Last Updated**: 2026-09-05 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ng-password-strength-maintained Password strength checker wrapped in an angular directive Based on: * [http://blog.brunoscopelliti.com/angularjs-directive-to-test-the-strength-of-a-password][bruno] * [http://www.passwordmeter.com][meter] [bruno]: http://blog.brunoscopelliti.com/angularjs-directive-to-test-the-strength-of-a-password [meter]: http://www.passwordmeter.com ## Examples See `app/index.html` in the respository. [Live example] [live-example] [live-example]: http://subarroca.github.io/ng-password-strength/ ## Usage 1. Bower should add `ng-password-strength.min.js` to you main file (index.html) you can download this by: * using bower and running `bower install ng-password-strength` * downloading the [production version][min] or the [development version][max]. [min]: https://raw.github.com/subarroca/ng-password-strength/master/dist/ng-password-strength.min.js [max]: https://raw.github.com/subarroca/ng-password-strength/master/dist/ng-password-strength.js In your web page: ```html ``` 2. Bower should add `ng-password-strength` to your main file (index.html). Some of them are not automatically added so you'd better check them. ```html ``` 3. Set `ng-password-strength` as a dependency in your module ```javascript var myapp = angular.module('myapp', ['ngPasswordStrength']) ``` 4. Add ng-password-strength directive to the wanted element, example: ```html
....
``` * Accepted addtional params: * strength: value returned [0-100] * css-mode: 'foundation' or 'bootstrap'. Sets inner-class, inner-class-prefix, outter-class-prefix. No need to set one by one * inner-class: inner bar class (i.e. 'progress-bar') * inner-class-prefix: inner bar class prefix (i.e. 'progress-bar-' => 'progress-bar-success') * outter-class-prefix: root element class prefix (i.e. 'progress-bar-' => 'progress-bar-success') * calculation-mode: 'formula' (default) or 'entropy'. Formula is explained below * goal: only used in entropy mode. Fixes the amount to reach. Default: 96 ## Formula Values limited to [0-100] * Pros: * Number of Characters `+ n*4` * Uppercase Letters (if any uppercase) `+ (len-n)*2` * Lowercase Letters (if any lowercase) `+ (len-n)*2` * Numbers (if any letter) `+ n*4` * Symbols `+ n*6` * Middle Numbers or Symbols `+ n*2` * Requirements `+ n*2` * Cons: * Letters Only `- n` * Numbers Only `- n` * Repeat Characters (Case Insensitive) `- (n/len) *10` * Consecutive Uppercase Letters `- n*2` * Consecutive Lowercase Letters `- n*2` * Consecutive Numbers `- n*2` * Sequential Letters (3+) `- n*3` * Sequential Numbers (3+) `- n*3` * Sequential Symbols (3+) `- n*3` ## TODO Create tests ## Changelog ### v0.3.0 * formula calculation moved to factory * added entropy calculation in a new factory * template moved to detached html ### v0.2.0 * added dependency: lodash * removed dependencies: bootstrap, ng-lodash * added classes for further customization * added modes for faster customization: [foundation, bootstrap] ### v0.1.0 * added dependency: ng-lodash * removed dependencies: underscore.string * changed compass to node-sass ### v0.0.8 * lodash update ### v0.0.7 * strength value feedback ### v0.0.6 * change underscore to lodash ### v0.0.1 * formula-based value calculations