Miss any of our Open RFC calls?Watch the recordings here! »

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

Install

npm i string-entropy

DownloadsWeekly Downloads

16

Version

0.0.2

License

MIT

Last publish

Collaborators

  • avatar