Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: migrate to null safety #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/src/algorithm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/src/algorithms/pbkdf2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
7 changes: 4 additions & 3 deletions pubspec.yaml
Original file line number Diff line number Diff line change
@@ -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 <lc@leocavalcante.com>
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