Skip to content

Commit b515690

Browse files
chore: checking mnemonics.count with range ~=
1 parent 3788524 commit b515690

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Sources/Web3Core/KeystoreManager/BIP39.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ public class BIP39 {
152152
}
153153

154154
public static func mnemonicsToEntropy(_ mnemonics: [String], language: BIP39Language = .english) -> Data? {
155-
guard mnemonics.count >= 12 && mnemonics.count.isMultiple(of: 3) && mnemonics.count <= 24 else { return nil }
155+
guard 12...24 ~= mnemonics.count && mnemonics.count.isMultiple(of: 3) else { return nil }
156156
var bitString = ""
157157
for word in mnemonics {
158158
guard let idx = language.words.firstIndex(of: word) else {

0 commit comments

Comments
 (0)