string-entropy

0.0.2 • Public • Published

string-entropy

Calculate the information entropy of a string

Build Status

As pointed out by other sources, string entropy is propably the most reliable way of scoring a password. This module implements the algorithm described here, using a variable sized alphabet based on the actual contents of the string.

image of the formula for information entropy calculation

Documentation

See the annotated sources or have a look at index.js.

Browser support

A number of builds are available in the dist folder. Checkout the demo for an example of this module implemented as a bootstrap plugin.

Example

var entropy = require('string-entropy');
 
console.log(entropy('correct horse battery staple'));
// outputs  132
console.log(entropy('Secret01'));
// outputs    66

Package Sidebar

Install

npm i string-entropy

Weekly Downloads

26

Version

0.0.2

License

MIT

Last publish

Collaborators

  • mvhenten