Browse Source

Changed unicodeHexMap from [UnicodeScalar:UInt8] to Dictionary<UnicodeScala,UInt8> in Array(hex) to be more consistent with project coding style

jose 8 năm trước cách đây
mục cha
commit
695ff5a17f
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      Sources/CryptoSwift/Array+Extension.swift

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

@@ -34,7 +34,7 @@ extension Array where Element: Integer, Element.IntegerLiteralType == UInt8 {
 
     public init(hex: String) {
         self.init(reserveCapacity: hex.unicodeScalars.lazy.underestimatedCount)
-        let unicodeHexMap:[UnicodeScalar:UInt8] = ["0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"a":10,"b":11,"c":12,"d":13,"e":14,"f":15,"A":10,"B":11,"C":12,"D":13,"E":14,"F":15]
+        let unicodeHexMap:Dictionary<UnicodeScalar,UInt8> = ["0":0,"1":1,"2":2,"3":3,"4":4,"5":5,"6":6,"7":7,"8":8,"9":9,"a":10,"b":11,"c":12,"d":13,"e":14,"f":15,"A":10,"B":11,"C":12,"D":13,"E":14,"F":15]
         var buffer:UInt8?
         var skip = hex.hasPrefix("0x") ? 2 : 0
         for char in hex.unicodeScalars.lazy {