Swiftpack.co - anquii/BIP39 as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by anquii.
anquii/BIP39 v1.0.2
An implementation of BIP-0039 in Swift
⭐️ 3
🕓 1 week ago
iOS macOS
.package(url: "https://github.com/anquii/BIP39.git", from: "v1.0.2")

BIP39

Platform Swift Package Manager compatible License

An implementation of BIP-0039 in Swift.

Platforms

  • macOS 10.15+
  • iOS 13+

Installation

Swift Package Manager

Add the following line to your Package.swift file:

.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.

Usage

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: "")

License

BIP39 is licensed under the terms of the MIT license. See the LICENSE file for more information.

Acknowledgments

In developing BIP39, KevinVitale's WalletKit has been used as a reference implementation. In addition, BIP39 depends on krzyzanowskim's CryptoSwift for crypto operations.

GitHub

link
Stars: 3
Last commit: 1 week ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

v1.0.2
1 week ago

Updated 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

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics