secure_password_utility 1.0.0
secure_password_utility: ^1.0.0 copied to clipboard
This password utility encourages the use of strong passwords in flutter apps.
example/secure_password_utility_example.dart
import 'package:secure_password_utility/secure_password_utility.dart';
void main() {
checkPasswordStrength('#sh0klmNZa',10);
//createPassword(14);
//createProductKey(20);
}
//Check the strength of your password. It returns a boolean
Future<bool> checkPasswordStrength(String password, int passwordLength) async {
var passcodeStrength = false;
await SecurePasswordGateway().checkWeakPassword(password,passwordLength)
.then((value) => {
passcodeStrength = value
});
print('Strong password is $passcodeStrength');
return passcodeStrength;
}
//Create a new password with a certain length
Future<dynamic> createPassword(int passwordLength) async {
var createdPassword = '';
await SecurePasswordGateway().generateStrongPassword(passwordLength)
.then((value) => createdPassword = value);
print('generated strong password is $createdPassword');
return createdPassword;
}
String createProductKey(int productKeyLength) {
var res = SecurePasswordGateway().generateProductKey(productKeyLength);
print('PRODUCT KEY IS::::: $res');
return res;
}