An implementation of BIP-0039 in Swift.
Add the following line to your
.package(url: "https://github.com/anquii/BIP39.git", from: "1.0.0")
...or integrate with Xcode via
File -> Swift Packages -> Add Package Dependency... using the URL of the repository.
import BIP39 let entropyGenerator: EntropyGenerating = EntropyGenerator() let entropy = try entropyGenerator.entropy(security: .strongest) let wordListProvider: WordListProviding = EnglishWordListProvider() let mnemonicConstructor: MnemonicConstructing = MnemonicConstructor() let mnemonic = mnemonicConstructor.mnemonic(entropy: entropy, wordList: wordListProvider.wordList) let seedDerivator: SeedDerivating = SeedDerivator() let seed = try seedDerivator.seed(mnemonic: mnemonic, passphrase: "")
BIP39 is licensed under the terms of the MIT license. See the LICENSE file for more information.
|Last commit: 1 week ago|
SeedDerivator to encode the given mnemonic and passphrase as UTF-8 NFKD before using them as input in the PBKDF2 function when derivating the binary seed.
Full Changelog: https://github.com/anquii/BIP39/compare/v1.0.1...v1.0.2