Skip to content

Password strength calculator based on passwordmeter.com

License

Notifications You must be signed in to change notification settings

lechuckroh/password-meter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

password-meter

Password strength calculator written in TypeScript.

Scoring rule is based on The Password Meter.

Password strength value is from 0 to 100.

Usage

import getPasswordStrength from "https://deno.land/x/password_meter/mod.ts";

const strength = getPasswordStrength('Password');
console.log(`'Password' strength is ${strength}`);

// 'Password' strength is 26 

To add custom calculators:

import getPasswordStrength from "https://deno.land/x/password_meter/mod.ts";
import {allCalcFunctions} from "https://deno.land/x/password_meter/functions.ts";

const myCalc = (s: string): number => s.length;
const strength = getPasswordStrength('Password', {
  functions: [
    ...allCalcFunctions,
    myCalc,
  ],
});
console.log(`'Password' strength is ${strength}`);

About

Password strength calculator based on passwordmeter.com

Resources

License

Stars

Watchers

Forks

Packages

No packages published