File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Sources/web3swift/KeystoreManager Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,11 @@ public class BIP39 {
99
99
100
100
- Returns: random 12-24 words, that represent new Mnemonic phrase.
101
101
*/
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
102
107
static public func generateMnemonics( bitsOfEntropy: Int , language: BIP39Language = BIP39Language . english) throws -> String ? {
103
108
guard bitsOfEntropy >= 128 && bitsOfEntropy <= 256 && bitsOfEntropy. isMultiple ( of: 32 ) else { return nil }
104
109
guard let entropy = Data . randomBytes ( length: bitsOfEntropy/ 8 ) else { throw AbstractKeystoreError . noEntropyError}
You can’t perform that action at this time.
0 commit comments