custom_password function

dynamic custom_password(
  1. String tag,
  2. String master_password,
  3. String secret_key,
  4. int length,
  5. int min_upper_alphas,
  6. int min_lower_alphas,
  7. int min_digits,
  8. int min_specials
)

Implementation

custom_password(
    String tag,
    String master_password,
    String secret_key,
    int length,
    int min_upper_alphas,
    int min_lower_alphas,
    int min_digits,
    int min_specials) {
  /// Password generator with custom security directives
  if (master_password == '') {
    return '';
  }
  if (secret_key != null) {
    tag = Hasher.custom(secret_key, tag, 24, min_upper_alphas, min_lower_alphas,
            min_digits, min_specials)
        .hash();
  }

  return Hasher.custom(tag, master_password, length, min_upper_alphas,
          min_lower_alphas, min_digits, min_specials)
      .hash();
}