Go to file
Francisco Gindre 716a2c32ac
Merge pull request #33 from zcash-hackworks/release/2.2.4
[#32] Update Swift-Crypto to 2.1.0
2022-04-28 09:14:28 -03:00
Examples/MnemonicSwiftExample.playground fix playground 2020-06-08 18:26:42 -03:00
MnemonicSwift MnemonicLanguageType Codable update 2022-03-23 09:32:46 +01:00
MnemonicSwift.xcodeproj MnemonicSwift 2.2.0 includes 2022-03-15 09:24:21 -03:00
Tests Fix: Issue #14 Type 'Bundle' has no member 'module' 2022-01-19 15:35:44 -03:00
.gitignore SwiftPM 2021-12-17 06:04:17 -06:00
.slather.yml Rebrand to MnemonicSwift 2020-06-08 18:17:51 -03:00
.swiftlint.yml Rebrand to MnemonicSwift 2020-06-08 18:17:51 -03:00
.travis.yml fix target for ios build 2020-06-13 18:23:54 -03:00
CHANGELOG.md [#32] Update Swift-Crypto to 2.1.0 2022-04-27 20:34:46 -03:00
CONTRIBUTING.md [#34] Update "Commit Messages" section of CONTRIBUTING.md 2022-04-28 08:52:34 -03:00
COPYING.md Issue #12 Review Licensing changes 2022-01-19 15:33:16 -03:00
Cartfile Remove CryptoSwift add CryptoKit. Bump OS Versions 2020-02-27 20:15:57 -03:00
Cartfile.resolved Remove CryptoSwift add CryptoKit. Bump OS Versions 2020-02-27 20:15:57 -03:00
Gemfile more build infra 2019-10-27 21:20:33 -06:00
LICENSE-APACHE SwiftPM 2021-12-17 06:04:17 -06:00
LICENSE-MIT Issue #12 Review Licensing changes 2022-01-19 15:33:16 -03:00
MnemonicSwift.podspec [#32] Update Swift-Crypto to 2.1.0 2022-04-27 20:34:46 -03:00
NOTICE.SwiftCrypto.txt SwiftPM 2021-12-17 06:04:17 -06:00
Package.resolved [#32] Update Swift-Crypto to 2.1.0 2022-04-27 20:34:46 -03:00
Package.swift [#32] Update Swift-Crypto to 2.1.0 2022-04-27 20:34:46 -03:00
README.md Issue #12 Review Licensing changes 2022-01-19 15:33:16 -03:00
codecov.yml Update paths for codecov ignore 2019-01-27 18:46:50 +00:00
project.yml replace all MnemonicKit 2020-06-12 20:56:18 -03:00

README.md

MnemonicSwift

Build Status

An implementation of BIP39 in Swift. MnemonicSwift supports both English and Chinese mnemonics.

This library is a fork of MnemonicKit. This fork provides provides support for BIP39 using Crypto.

NOTE to 1.0.0 users: If you are using 1.0.0 in your project, we no longer maintain that version. Upgrade to 2.0.0 immediately.

Installation

CocoaPods

MnemonicSwift supports installation via CocoaPods. You can depened on MnemonicSwift by adding the following to your Podfile:

pod "MnemonicSwift"

Carthage

If you use Carthage to manage your dependencies, simply add MnemonicSwift to your Cartfile:

github "zcash-hackworks/MnemonicSwift"

Usage

Generate a Mnemonic

  let englishMnemonic = Mnemonic.generateMnemonic(strength: 64, language: .english)
  let chineseMnemonic = Mnemonic.generateMnemonic(strength: 128, language: .chinese)

Generate a Mnemonic from a Hex Representation

  let hexRepresentation: String = ...
  let mnemonic = Mnemonic.mnemonicString(from: hexRepresentation)
  print("Mnemonic: \(mnemonic)\nFrom hex string: \(hexRepresentation)")

Generate a Seed String

  let englishMnemonic = Mnemonic.generateMnemonic(strength: 64, language: .english)
  let passphrase: String = ...
  let deterministicSeedString = Mnemonic.deterministicSeedString(from: mnemonicString,
                                                                 passphrase: passphrase,
                                                                 language: .english)
  print("Deterministic Seed String: \(deterministicSeedString)")

Setting up the project as contributor

To get set up:

$ brew install xcodegen # if you don't already have it
$ xcodegen generate # Generate an XCode project from Project.yml
$ open MnemonicSwift.xcodeproj

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.