Skip to content

Commit 6b15511

Browse files
committed
📖 doc update
1 parent 58dc27d commit 6b15511

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Sources/web3swift/KeystoreManager/BIP39.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ public class BIP39 {
9999

100100
- Returns: random 12-24 words, that represent new Mnemonic phrase.
101101
*/
102+
103+
/// Initializes a new mnemonics set with the provided bitsOfEntropy.
104+
/// - Parameters:
105+
/// - bitsOfEntropy: 128 - 12 words, 192 - 18 words , 256 - 24 words in output.
106+
/// - language: words language, default english
102107
static public func generateMnemonics(bitsOfEntropy: Int, language: BIP39Language = BIP39Language.english) throws -> String? {
103108
guard bitsOfEntropy >= 128 && bitsOfEntropy <= 256 && bitsOfEntropy.isMultiple(of: 32) else {return nil}
104109
guard let entropy = Data.randomBytes(length: bitsOfEntropy/8) else {throw AbstractKeystoreError.noEntropyError}

0 commit comments

Comments
 (0)