password_strength 0.1.2

Password Strength Estimator #

A basic password strength estimator for Dart. Considers the length of the password, used characters, and whether or not the password appears in the top 10,000 most used passwords.

Usage #

import 'package:password_strength/password_strength.dart';


double strength = estimatePasswordStrength('passw0rd');

if (strength < 0.3)
  print('This password is weak!');

0.1.2 #

  • Fix repository link
  • Return 0.0 for empty strings

0.1.1 #

  • Apply health suggestions
  • Fix maintenance issues and apply suggestions

0.1.0 #

  • Initial release


import 'dart:io';
import 'package:password_strength/password_strength.dart';

void main() {
  // Read a password from stdin.
  print('Please enter a password:');
  final password = stdin.readLineSync();

  // Estimate the password's strength.
  double strength = estimatePasswordStrength(password);

  // Print a response
  if (strength < 0.3) {
    print('This password is weak!');
  } else if (strength < 0.7) {
    print('This password is alright.');
  } else {
    print('This passsword is strong!');

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  password_strength: ^0.1.2

2. Install it

You can install packages from the command line:

with pub:

$ pub get

with Flutter:

$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:password_strength/password_strength.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

We analyzed this package on Feb 13, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.7.1
  • pana: 0.13.5


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
Dev dependencies
test ^1.6.3