From cdcce122fad8d5fb3a7f445e703ef318d6c50375 Mon Sep 17 00:00:00 2001 From: Francisco Gindre Date: Tue, 21 Dec 2021 10:22:44 -0300 Subject: [PATCH] Fix randomIndices() --- secant/Features/BackupFlow/RecoveryPhraseValidation.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/secant/Features/BackupFlow/RecoveryPhraseValidation.swift b/secant/Features/BackupFlow/RecoveryPhraseValidation.swift index 139fc79..545852c 100644 --- a/secant/Features/BackupFlow/RecoveryPhraseValidation.swift +++ b/secant/Features/BackupFlow/RecoveryPhraseValidation.swift @@ -164,7 +164,11 @@ extension RecoveryPhraseValidationState { } static func randomIndices() -> [Int] { - Array(repeating: Int.random(in: 0...wordGroupSize - 1), count: phraseChunks) + var indices = [Int]() + for _ in (0 ..< phraseChunks) { + indices.append(Int.random(in: 0 ..< wordGroupSize)) + } + return indices } }