Go to file
Francisco Gindre a497776644 Add SPM folder structure and import Crypto 2020-06-15 14:52:38 -03:00
Examples/MnemonicSwiftExample.playground fix playground 2020-06-08 18:26:42 -03:00
MnemonicSwift.xcodeproj Add SPM folder structure and import Crypto 2020-06-15 14:52:38 -03:00
Sources/MnemonicSwift Add SPM folder structure and import Crypto 2020-06-15 14:52:38 -03:00
Tests/MnemonicSwift Add SPM folder structure and import Crypto 2020-06-15 14:52:38 -03:00
.gitignore Check in Xcode project 2019-11-03 17:27:48 -08: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 cleanup 2020-04-18 00:28:23 +09:00
Cartfile Upgrade deps 2020-04-14 23:35:14 +09:00
Cartfile.resolved fix warnings 2020-04-15 16:11:18 +09:00
Gemfile more build infra 2019-10-27 21:20:33 -06:00
LICENSE Rebrand to MnemonicSwift 2020-06-08 18:17:51 -03:00
MnemonicSwift.podspec Add SPM folder structure and import Crypto 2020-06-15 14:52:38 -03:00
Package.swift Add SPM folder structure and import Crypto 2020-06-15 14:52:38 -03:00
README.md Add travis status indicator 2020-06-12 15:32:47 -06:00
codecov.yml Update paths for codecov ignore 2019-01-27 18:46:50 +00:00
project.yml update xcodegen format 2020-04-14 23:55:32 +09: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 CryptoKit.

Installation

CocoaPods

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

pod "MnemonicSwift"

Carthage

If you use Carthage to manage your dependencies, simply add MnemonicKit 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)")

Contributions

To get set up:

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

License

MIT