Skip to content

Commit

Permalink
public methods
Browse files Browse the repository at this point in the history
  • Loading branch information
Cocody committed Jul 25, 2017
1 parent fe5dac7 commit 7a63520
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions CKMnemonic/CKMnemonic/CKMnemonic/CKMnemonic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ enum CKMnemonicError: Error
}

public class CKMnemonic: NSObject {
static func mnemonicString(from hexString: String, language: CKMnemonicLanguageType) throws -> String {
public static func mnemonicString(from hexString: String, language: CKMnemonicLanguageType) throws -> String {
let seedData = hexString.ck_mnemonicData()
print("\(hexString.characters.count)\t\(seedData.count)")
let hashData = seedData.sha256()
Expand Down Expand Up @@ -59,7 +59,7 @@ public class CKMnemonic: NSObject {
return mnemonic.joined(separator: " ")
}

static func deterministicSeedString(from mnemonic: String, passphrase: String = "", language: CKMnemonicLanguageType) -> String {
public static func deterministicSeedString(from mnemonic: String, passphrase: String = "", language: CKMnemonicLanguageType) -> String {

func normalized(string: String) -> Data? {
guard let data = string.data(using: .utf8, allowLossyConversion: true) else {
Expand Down Expand Up @@ -97,7 +97,7 @@ public class CKMnemonic: NSObject {
}
}

static func generateMnemonic(strength: Int, language: CKMnemonicLanguageType) throws -> String {
public static func generateMnemonic(strength: Int, language: CKMnemonicLanguageType) throws -> String {
guard strength % 32 == 0 else {
throw CKMnemonicError.invalidStrength
}
Expand Down
4 changes: 2 additions & 2 deletions CKMnemonic/CKMnemonic/CKMnemonic/Data+CKBitArray.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation
import CryptoSwift

public extension UInt8 {
func ck_bits() -> [String] {
public func ck_bits() -> [String] {
let totalBitsCount = MemoryLayout<UInt8>.size * 8

var bitsArray = [String](repeating: "0", count: totalBitsCount)
Expand All @@ -28,7 +28,7 @@ public extension UInt8 {
}

public extension Data {
func ck_toBitArray() -> [String] {
public func ck_toBitArray() -> [String] {
var toReturn = [String]()
for num: UInt8 in bytes {

Expand Down
2 changes: 1 addition & 1 deletion CKMnemonic/CKMnemonic/CKMnemonic/String+MnemonicData.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Foundation

public extension String
{
func ck_mnemonicData() -> Data {
public func ck_mnemonicData() -> Data {
let length = characters.count
let dataLength = length / 2
var dataToReturn = Data(capacity: dataLength)
Expand Down

0 comments on commit 7a63520

Please sign in to comment.