passwd 1.1.0 copy "passwd: ^1.1.0" to clipboard
passwd: ^1.1.0 copied to clipboard

A package for generating strong passwords and measuring password strength.

example/passwd_example.dart

import 'package:passwd/passwd.dart';

void main() {
  print(generatePassword()); // wAOrDoQM

  print(
    generatePassword(
      length: 20,
      upperCase: true,
    ),
  ); // EKBRFDILDXRDLLKHKTMG

  print(
    generatePassword(
      length: 20,
      upperCase: true,
      lowerCase: true,
    ),
  ); // tsQWcXgeFtlajRYRYrUD

  print(
    generatePassword(
      length: 20,
      upperCase: true,
      lowerCase: true,
      digits: true,
    ),
  ); // eCrl6rQqcewzy2kbw7fZ

  print(
    generatePassword(
      length: 40,
      upperCase: true,
      lowerCase: true,
      digits: true,
      punctuation: true,
    ),
  ); //>1.)}|4wyW35xJxYRd"H

  // Measure the strength of the password
  print(estimateStrength('123456')); // PasswordStrength.weak

  print(estimateStrength('slcjreiuvmk')); // PasswordStrength.weak

  print(estimateStrength('KEURIBVJKIUYER')); // PasswordStrength.weak

  print(estimateStrength('setgf784156')); // PasswordStrength.good

  print(estimateStrength('euhnvHHJGkjhjk')); // PasswordStrength.good

  print(estimateStrength('fYjV')); // PasswordStrength.weak

  print(estimateStrength('fhjTYRxs48hgRT')); // PasswordStrength.good

  print(estimateStrength('pN47bT')); // PasswordStrength.weak

  print(estimateStrength('hjfR^f87984L;&gh')); // PasswordStrength.strong

  // Measure the strength of generated passwords
  print(estimateStrength(generatePassword()));
  // PasswordStrength.good

  print(estimateStrength(generatePassword(upperCase: true)));
  // PasswordStrength.weak

  print(estimateStrength(generatePassword(punctuation: true)));
  // PasswordStrength.strong

  print(estimateStrength(generatePassword(punctuation: true, digits: true)));
  // PasswordStrength.strong

  print(
    estimateStrength(
      generatePassword(
        length: 15,
        punctuation: true,
        digits: true,
      ),
    ),
  ); // PasswordStrength.strong
}
5
likes
160
points
46
downloads

Publisher

unverified uploader

Weekly Downloads

A package for generating strong passwords and measuring password strength.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

More

Packages that depend on passwd