Form.PasswordStrength 0.1

Places an animated meter below an input element, displaying the strength of a password calculated using simple information entropy.



Details

Author
Nevada
Current version
0.1
GitHub
nak5ive/Form.PasswordStrength
Downloads
1402
Category
Forms
Tags
Report
GitHub Issues

Releases


Dependencies

  • _self_/_current_: core/1.3.1: '*'

How to use

Include Mootools.Core and Form.PasswordStrength in your document:

<script type="text/javascript" src="mootools-1.3.1-core-yc.js"></script>
<script type="text/javascript" src="Form.PasswordStrength.js"></script>

Instantiate a new Form.PasswordStrength object and set it's options:

<input id="mypassword" type="password" name="mypassword" value=""/>

<script type="text/javascript">
    new Form.PasswordStrength('mypassword', {options});
</script>

Options

threshold - An entropy value that represents the highest password strength to measure. In this application, entropy is a measure of strength dependent on the length of a string and the sample size of characters for which a brute force attack must consider when looking for a match. Defaults to 66 (the entropy value for a 10-character string consisting of at least 1 number, 1 lowercase letter, 1 uppercase letter, and 1 special character).

primer - A sample string that represents the highest password strength to measure. Since strength in entropy is relative to what is considered to be "strong", it can be difficult to guess a number value to represent threshold. Set this option with a string that has all the characteristics you would expect in a "strong" password. This option will override the threshold option. Defaults to ''.

height - The height of the strength meter, in px. Defaults to 5.

opacity - The opacity of the strength meter, from 0 to 1. Defaults to 1.

bgcolor - The background-color style attribute on the strength meter. Defaults to 'transparent'.


Events

onUpdate - Fired every time the value of the input field changes. Arguments available [element, strength, threshold].


Discuss

A note on comments here: These comments are moderated. No comments will show up until they are approved. Comments that are not productive (i.e. inflammatory, rude, etc) will not be approved.

Found a bug in this plugin? Please report it this repository's Github Issues.

blog comments powered by Disqus