Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 1.11 KB

README.md

File metadata and controls

34 lines (20 loc) · 1.11 KB

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

Demo

A simple password strength meter that updates as you type.

Documentation

See the annotated sources src/index.ts.

Example

const { entropy } = require('string-entropy');

console.log(entropy('correct horse battery staple'));
// outputs  132
console.log(entropy('Secret01'));
// outputs    66