Преглед изворни кода

Marking bits / chunks method as public

Ludo Galabru пре 8 година
родитељ
комит
a8290c9bf1

+ 1 - 1
Sources/CryptoSwift/Array+Extension.swift

@@ -16,7 +16,7 @@ extension Array {
 extension Array {
 extension Array {
 
 
     /** split in chunks with given chunk size */
     /** split in chunks with given chunk size */
-    func chunks(size chunksize: Int) -> Array<Array<Element>> {
+    public func chunks(size chunksize: Int) -> Array<Array<Element>> {
         var words = Array<Array<Element>>()
         var words = Array<Array<Element>>()
         words.reserveCapacity(self.count / chunksize)
         words.reserveCapacity(self.count / chunksize)
         for idx in stride(from: chunksize, through: self.count, by: chunksize) {
         for idx in stride(from: chunksize, through: self.count, by: chunksize) {

+ 1 - 1
Sources/CryptoSwift/Bit.swift

@@ -6,7 +6,7 @@
 //  Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
 //  Copyright © 2016 Marcin Krzyzanowski. All rights reserved.
 //
 //
 
 
-enum Bit: Int {
+public enum Bit: Int {
     case zero
     case zero
     case one
     case one
 }
 }

+ 2 - 2
Sources/CryptoSwift/UInt8+Extension.swift

@@ -43,7 +43,7 @@ extension UInt8 {
     }
     }
 
 
     /** array of bits */
     /** array of bits */
-    func bits() -> [Bit] {
+    public func bits() -> [Bit] {
         let totalBitsCount = MemoryLayout<UInt8>.size * 8
         let totalBitsCount = MemoryLayout<UInt8>.size * 8
 
 
         var bitsArray = [Bit](repeating: Bit.zero, count: totalBitsCount)
         var bitsArray = [Bit](repeating: Bit.zero, count: totalBitsCount)
@@ -59,7 +59,7 @@ extension UInt8 {
         return bitsArray
         return bitsArray
     }
     }
 
 
-    func bits() -> String {
+    public func bits() -> String {
         var s = String()
         var s = String()
         let arr: [Bit] = self.bits()
         let arr: [Bit] = self.bits()
         for idx in arr.indices {
         for idx in arr.indices {