File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
packages/aws_common/lib/src/util Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change 15
15
import 'package:uuid/uuid.dart' ;
16
16
import 'package:uuid/uuid_util.dart' ;
17
17
18
- /// Generates a crypto-secure UUID (v4).
19
- String uuid () => const Uuid ().v4 (
20
- // Use the crypto-secure RNG per `package:uuid` docs:
21
- // https://github.com/Daegalus/dart-uuid/blob/d7bc930942afc752edd0fd15f8bf8234d81dfeda/example/example.dart#L21
22
- options: const < String , Object > {
23
- 'rng' : UuidUtil .cryptoRNG,
24
- },
18
+ /// Generates a UUID (v4).
19
+ ///
20
+ /// If [secure] is `true` , uses a crypto-secure RNG at the cost of worse
21
+ /// performance (5-100x, depending on the platform).
22
+ String uuid ({bool secure = false }) => const Uuid ().v4 (
23
+ options: ! secure
24
+ ? null
25
+ // Use the crypto-secure RNG per `package:uuid` docs:
26
+ // https://github.com/Daegalus/dart-uuid/blob/d7bc930942afc752edd0fd15f8bf8234d81dfeda/example/example.dart#L21
27
+ : const < String , Object > {
28
+ 'rng' : UuidUtil .cryptoRNG,
29
+ },
25
30
);
You can’t perform that action at this time.
0 commit comments