Go to file
Marek Fořt d14d275981 Podspec changes. 2018-12-21 16:43:26 +01:00
MnemonicKit Rig up a unit testing target. 2018-12-09 19:21:48 +00:00
MnemonicKit.xcodeproj Generate code coverage report 2018-12-09 20:41:05 +00:00
MnemonicKit.xcworkspace Pod install 2018-10-28 18:44:37 +00:00
MnemonicKitTests Rig up a unit testing target. 2018-12-09 19:21:48 +00:00
MnemonicKitTests2 Discard new unit test file 2018-12-09 19:22:52 +00:00
Pods Fix Podfile 2018-12-09 20:31:26 +00:00
Sources Get ExampleApp building 2018-12-09 20:04:07 +00:00
.gitignore Update gitignore 2018-10-28 17:58:10 +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 Don't build the test target. It isn't configured for running. 2018-12-09 20:35:52 +00: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 Podspec changes. 2018-12-21 16:43:26 +01:00
Podfile Fix Podfile 2018-12-09 20:31:26 +00:00
Podfile.lock Fix Podfile 2018-12-09 20:31:26 +00:00
README.md Update README.md 2018-11-05 02:01:48 +00:00
codecov.yml Fixing code coverage. 2018-10-28 19:29:37 +00:00

README.md

MnemonicKit     Build Status     codecov

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

This library is a fork of (CKMnemonic)[https://github.com/CikeQiu/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"

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