From f562c6b69bed93351cc17e41296ab9ba645459f4 Mon Sep 17 00:00:00 2001 From: Nika Hassani Date: Mon, 4 Dec 2023 11:15:57 -0800 Subject: [PATCH] add namedArgs and positionalArgs as they are required parameter in uuid v4, these parameter are optional in uuid v3 --- packages/aws_common/lib/src/util/uuid.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/packages/aws_common/lib/src/util/uuid.dart b/packages/aws_common/lib/src/util/uuid.dart index 3e93afe546..ae163778a3 100644 --- a/packages/aws_common/lib/src/util/uuid.dart +++ b/packages/aws_common/lib/src/util/uuid.dart @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2.0 import 'dart:math'; +import 'dart:typed_data'; import 'package:uuid/uuid.dart'; @@ -15,10 +16,14 @@ String uuid({bool secure = false}) => const Uuid().v4( ? null : const { 'rng': _cryptoRNG, + 'positionalArgs': [], + 'namedArgs': {}, }, ); /// Creates 16 digit cryptographically secure random number. -List _cryptoRNG() { - return List.generate(16, (i) => Random.secure().nextInt(256)); +Uint8List _cryptoRNG() { + return Uint8List.fromList( + List.generate(16, (i) => Random.secure().nextInt(256)), + ); }