# jQuery Entropizer *Password strength meter jQuery plugin* For the standalone Entropizer engine, click [here](https://github.com/jreesuk/entropizer) ## What is jQuery Entropizer? jQuery Entropizer is a simple, lightweight jQuery plugin that uses the [Entropizer engine](https://github.com/jreesuk/entropizer) to calculate password entropy. It's easy to set up and provides several hooks to customize the UI. jQuery Entropizer supports [AMD](http://requirejs.org/) and [CommonJS](http://wiki.commonjs.org/wiki/CommonJS). It is available as a [bower](http://bower.io/) component. ## Demos Some basic demos can be found [here](http://jreesuk.github.io/jquery-entropizer/). ## Getting Started This plugin requires both [jQuery](http://jquery.com/) (1.7.2+) and [Entropizer](https://github.com/jreesuk/entropizer). Basic usage: ```html
``` ```js // Creates a default Entropizer meter inside #meter and watches the first password field on the // page by default $('#meter').entropizer(); ``` Options and examples: ```js // Create an Entropizer meter using custom options $('#meter').entropizer({ // The input field to watch: any selector, DOM element or jQuery instance // Default: 'input[type=password]:first' target: '#pwd', // The event(s) upon which to update the meter UI // Default: 'keydown keyup' on: 'keydown', // Used to calculate the percentage of the bar to fill (see map function below) // Default: 100 maximum: 80, // An array of ranges to use when classifying password strength. Used internally by default map // function and can be used publicly via $.entropizer.classify(value, buckets). Properties // 'min' and 'max' are used to calculate which bucket to use - upon finding a match, an object // containing all the other properties is returned, e.g. below, a value of 42 returns // { message: ':)' } // Default: 4 ranges with strength and color properties (see source for values) buckets: [ { max: 40, message: ':(' }, { min: 40, max: 60, message: ':)' }, { min: 60, message: ':D' } ], // Either an Entropizer engine options object or an Entropizer instance // Default: a new Entropizer instance with default settings engine: { classes: ['lowercase', 'uppercase', 'numeric'] }, // A callback controlling UI creation - takes a jQuery instance representing the container // and returns an object containing UI components for access in update and destroy // Default: creates a track element (the bar background), a bar element and a text element create: function(container) { var bar = $('