1+ import 'dart:async' ;
2+
13import 'package:flutter/services.dart' ;
24import 'package:flutter/foundation.dart' ;
35
@@ -9,25 +11,25 @@ class FlutterBcrypt {
911 /// Salt must be a string in Modular Crypt Format with $ separators
1012 /// for example r'$2b$06$C6UzMDM.H6dfI/f/IKxGhu'
1113 static Future <String > hashPw (
12- {@ required String password, @ required String salt}) async =>
13- await _channel
14- .invokeMethod ('hashPw' , {'password' : password, 'salt' : salt});
14+ {required String password, required String salt}) async =>
15+ await ( _channel
16+ .invokeMethod ('hashPw' , {'password' : password, 'salt' : salt})) ;
1517
1618 /// Generate a 16 byte salt with 6 rounds of cost in Modular Crypt Format.
1719 static Future <String > salt () async =>
18- await _channel.invokeMethod ('salt' , {'rounds' : 6 });
20+ await ( _channel.invokeMethod ('salt' , {'rounds' : 6 }) );
1921
2022 /// Generate a salt with a given cost. Cost must be between 4 and 31.
21- static Future <String > saltWithRounds ({@ required int rounds}) async =>
22- await _channel.invokeMethod ('saltWithRounds' , {'rounds' : rounds});
23+ static Future <String > saltWithRounds ({required int rounds}) async =>
24+ await ( _channel.invokeMethod ('saltWithRounds' , {'rounds' : rounds}) );
2325
2426 /// Verify if the given password matches the given hash.
2527 /// Password must be a plain UTF-8 compatible String
2628 /// Hash must be provided in Modular Crypt Format. Eg.
2729 /// $2y$06$doGnefu9cbLkJTn8sef7U.dynHJFe5hS6xp7vLWb2Zu7e8cOuMVmS
2830 /// This includes the version, complexity and 16 bytes of salt.
2931 static Future <bool > verify (
30- {@ required String password, @ required String hash}) async =>
31- await _channel
32- .invokeMethod ('verify' , {'password' : password, 'hash' : hash});
32+ {required String password, required String hash}) async =>
33+ await ( _channel
34+ .invokeMethod ('verify' , {'password' : password, 'hash' : hash})) ;
3335}
0 commit comments