diff --git a/lib/src/algorithm.dart b/lib/src/algorithm.dart index f40e1e0..4119216 100644 --- a/lib/src/algorithm.dart +++ b/lib/src/algorithm.dart @@ -18,7 +18,7 @@ abstract class Algorithm { static Algorithm decode(String hash) { final parts = hash.split('\$'); final algoFactory = _algorithms[parts[1]]; - final algorithm = algoFactory(parts[2].split(','), parts[3]); + final algorithm = algoFactory!(parts[2].split(','), parts[3]); return algorithm; } diff --git a/lib/src/algorithms/pbkdf2.dart b/lib/src/algorithms/pbkdf2.dart index baa7378..eb16b91 100644 --- a/lib/src/algorithms/pbkdf2.dart +++ b/lib/src/algorithms/pbkdf2.dart @@ -18,14 +18,14 @@ class PBKDF2 extends Algorithm { final int iterationCount; final int desiredKeyLength; - PBKDF2KeyDerivator _derivator; - Uint8List _salt; + late PBKDF2KeyDerivator _derivator; + late Uint8List _salt; PBKDF2( {this.blockLength = 64, this.iterationCount = 10000, this.desiredKeyLength = 64, - String salt = null}) { + String? salt = null}) { final rnd = new FortunaRandom()..seed(new KeyParameter(new Uint8List(32))); _salt = diff --git a/pubspec.yaml b/pubspec.yaml index 5c3392c..3dc6bb3 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,13 +1,14 @@ name: password -version: 1.0.0 +version: 2.0.0 description: A set of high-level APIs over PointyCastle to hash and verify passwords securely. author: leocavalcante homepage: https://github.com/leocavalcante/password-dart environment: - sdk: ">=2.0.0 <3.0.0" + sdk: ">=2.12.0 <3.0.0" dependencies: - pointycastle: ^1.0.0 + pointycastle: ^3.0.1 + dev_dependencies: test: ^1.5.1+1