Go to file
Francisco Gindre f1377b9321
Fix: validate checksum bug + tests (#7)
* Fix: validate checksum + tests

* Changes per Review: make all cryptographic derivation functions throwing. Add tests

* Fix PR Comments

* PR fixes

* bump version to 2.0.0
2020-09-09 14:36:34 -03:00
Examples/MnemonicSwiftExample.playground fix playground 2020-06-08 18:26:42 -03:00
MnemonicSwift Fix: validate checksum bug + tests (#7) 2020-09-09 14:36:34 -03:00
MnemonicSwift.xcodeproj Fix: validate checksum bug + tests (#7) 2020-09-09 14:36:34 -03:00
Tests Fix: validate checksum bug + tests (#7) 2020-09-09 14:36:34 -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 fix target for ios build 2020-06-13 18:23:54 -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 Rebrand to MnemonicSwift 2020-06-08 18:17:51 -03:00
MnemonicSwift.podspec Fix: validate checksum bug + tests (#7) 2020-09-09 14:36:34 -03:00
README.md replace all MnemonicKit 2020-06-12 20:56:18 -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 CryptoKit.

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

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

License

MIT