Go to file
Keefer Taylor fa22ccf190
Merge pull request #12 from keefertaylor/restructure
Restructure File Structure
2019-01-18 02:06:44 +00:00
Examples/MnemonicKitExample.playground Fix folder structure 2019-01-18 01:51:52 +00:00
MnemonicKit Make travis setup work, deintegrate cocoapods. 2019-01-03 10:39:35 +01:00
MnemonicKit.xcodeproj Fix folder structure 2019-01-18 01:51:52 +00:00
Tests MnemonicKitTests -> Tests 2019-01-18 01:00:12 +00:00
.gitignore Ignore playground files 2019-01-18 01:17:43 +00:00
.slather.yml Fix slather config. 2018-12-09 20:44:29 +00:00
.swiftformat Add formatter. 2018-11-12 04:00:55 +00:00
.swiftlint.yml Remove swiftlint from xcodeproj 2018-12-09 17:49:24 +00:00
.travis.yml Fix repo name 2019-01-08 22:24:40 +00:00
Cartfile CryptoSwift imported with Carthage. 2018-12-21 17:35:02 +01:00
Cartfile.resolved CryptoSwift imported with Carthage. 2018-12-21 17:35:02 +01:00
Gemfile Fixing gemfile 2018-10-28 18:36:45 +00:00
LICENSE Initial commit 2017-07-24 21:59:55 +08:00
MnemonicKit.podspec bump fix number 2019-01-08 22:55:08 +00:00
README.md Add space to README. 2019-01-07 09:15:48 +01:00
codecov.yml Fixing code coverage. 2018-10-28 19:29:37 +00:00

README.md

MnemonicKit

Build Status codecov Carthage Compatible Version License

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

This library is a fork of CKMnemonic. This fork provides several conveniences over the original library, namely:

  • Converting throwing APIs to non-throwing nullable APIs
  • Additional helper methods
  • Code clarity and documentation
  • Additional Testing
  • Support on OSX

Installation

CocoaPods

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

pod "MnemonicKit"

Carthage

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

github "keefertaylor/MnemonicKit"

If you use Carthage to build your dependencies, make sure you have added CryptoSwift.framework to the "Linked Frameworks and Libraries" section of your target, and have included them in your Carthage framework copying build phase.

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

I am happy to accept pull requests. If anyone is able to reach the original authors of CKMnemonic, I am happy to merge this library upstream with them.

License

MIT