├── .swift-version ├── .gitignore ├── Sources └── SwiftyBase64 ├── Tests ├── SwiftyBase64Tests └── LinuxMain.swift ├── SwiftyBase64.xcodeproj ├── project.xcworkspace │ └── contents.xcworkspacedata ├── xcshareddata │ └── xcbaselines │ │ └── 9141D5C41B757AA6008208DF.xcbaseline │ │ ├── 018B7072-19F7-4760-9450-A0F08F906DF4.plist │ │ └── Info.plist └── project.pbxproj ├── tools ├── Makefile ├── generate_binary_testfile.c └── generate_alphabet_table.c ├── Package.swift ├── SwiftyBase64.podspec ├── SwiftyBase64Tests ├── Info.plist └── SwiftyBase64Tests.swift ├── SwiftyBase64 ├── Info.plist ├── Alphabets.swift └── Base64.swift ├── LICENSE └── README.md /.swift-version: -------------------------------------------------------------------------------- 1 | 3.0 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | xcuserdata 2 | -------------------------------------------------------------------------------- /Sources/SwiftyBase64: -------------------------------------------------------------------------------- 1 | ../SwiftyBase64/ -------------------------------------------------------------------------------- /Tests/SwiftyBase64Tests: -------------------------------------------------------------------------------- 1 | ../SwiftyBase64Tests/ -------------------------------------------------------------------------------- /Tests/LinuxMain.swift: -------------------------------------------------------------------------------- 1 | import XCTest 2 | @testable import SwiftyBase64Tests 3 | 4 | XCTMain([ 5 | testCase(SwiftyBase64Tests.allTests), 6 | ]) 7 | -------------------------------------------------------------------------------- /SwiftyBase64.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/Makefile: -------------------------------------------------------------------------------- 1 | all: generate_alphabet_table generate_binary_testfile 2 | 3 | generate_alphabet_table: generate_alphabet_table.c 4 | $(CC) $< -o $@ 5 | 6 | generate_binary_testfile: generate_binary_testfile.c 7 | $(CC) $< -o $@ 8 | 9 | clean: 10 | $(RM) generate_alphabet_table generate_binary_testfile 11 | -------------------------------------------------------------------------------- /Package.swift: -------------------------------------------------------------------------------- 1 | // swift-tools-version:4.0 2 | 3 | import PackageDescription 4 | 5 | let package = Package( 6 | name: "SwiftyBase64", 7 | products: [ 8 | .library(name:"SwiftyBase64", type:.dynamic, targets:["SwiftyBase64"]), 9 | ], 10 | dependencies: [], 11 | targets: [ 12 | .target(name:"SwiftyBase64", dependencies: [], path: "SwiftyBase64"), 13 | ], 14 | swiftLanguageVersions: [4] 15 | ) 16 | -------------------------------------------------------------------------------- /tools/generate_binary_testfile.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | int main(int argc, char** argv) { 5 | if (argc != 3) { 6 | fprintf(stderr, "Missing arguments.\nUsage: generate_binary_testfile \n"); 7 | exit(1); 8 | } 9 | 10 | int start = atoi(argv[1]); 11 | int end = atoi(argv[2]); 12 | 13 | if (start < 0 || start > end || end < 0) { 14 | fprintf(stderr, "Illegal start (%d) or end (%d) values.\n", start, end); 15 | exit(1); 16 | } 17 | 18 | for(int i = start; i <= end; ++i) { 19 | putc(i, stdout); 20 | } 21 | return 0; 22 | } 23 | 24 | -------------------------------------------------------------------------------- /SwiftyBase64.podspec: -------------------------------------------------------------------------------- 1 | Pod::Spec.new do |s| 2 | s.name = "SwiftyBase64" 3 | s.version = "1.1.1" 4 | s.summary = "base64 and base64url encoders in Swift" 5 | s.homepage = "https://github.com/drichardson/SwiftyBase64" 6 | s.license = { :type => "MIT", :file => "LICENSE" } 7 | s.author = { "Doug Richardson" => "dougie.richardson@gmail.com" } 8 | s.source = { :git => "https://github.com/drichardson/SwiftyBase64.git", :tag => s.version } 9 | s.source_files = "SwiftyBase64" 10 | 11 | s.ios.deployment_target = "8.0" 12 | #s.watchos.deployment_target = "2.0" watchos 13 | #s.tvos.deployment_target = "9.0" tvos 14 | s.osx.deployment_target = "10.10" #if this code support osx 10.10.ues it 15 | end 16 | -------------------------------------------------------------------------------- /SwiftyBase64.xcodeproj/xcshareddata/xcbaselines/9141D5C41B757AA6008208DF.xcbaseline/018B7072-19F7-4760-9450-A0F08F906DF4.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | classNames 6 | 7 | SwiftyBase64Tests 8 | 9 | testPerformanceBase64() 10 | 11 | com.apple.XCTPerformanceMetric_WallClockTime 12 | 13 | baselineAverage 14 | 0.04 15 | baselineIntegrationDisplayName 16 | Local Baseline 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /SwiftyBase64Tests/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | BNDL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | 1 23 | 24 | 25 | -------------------------------------------------------------------------------- /SwiftyBase64/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | en 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | $(PRODUCT_NAME) 15 | CFBundlePackageType 16 | FMWK 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleSignature 20 | ???? 21 | CFBundleVersion 22 | $(CURRENT_PROJECT_VERSION) 23 | NSPrincipalClass 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /SwiftyBase64.xcodeproj/xcshareddata/xcbaselines/9141D5C41B757AA6008208DF.xcbaseline/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | runDestinationsByUUID 6 | 7 | 018B7072-19F7-4760-9450-A0F08F906DF4 8 | 9 | localComputer 10 | 11 | busSpeedInMHz 12 | 100 13 | cpuCount 14 | 1 15 | cpuKind 16 | Intel Core i7 17 | cpuSpeedInMHz 18 | 2300 19 | logicalCPUCoresPerPackage 20 | 8 21 | modelCode 22 | MacBookPro9,1 23 | physicalCPUCoresPerPackage 24 | 4 25 | platformIdentifier 26 | com.apple.platform.macosx 27 | 28 | targetArchitecture 29 | x86_64 30 | targetDevice 31 | 32 | modelCode 33 | iPhone7,2 34 | platformIdentifier 35 | com.apple.platform.iphonesimulator 36 | 37 | 38 | 39 | 40 | 41 | -------------------------------------------------------------------------------- /tools/generate_alphabet_table.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | static void printEntry(char encoding, int value) { 4 | printf("%d, // %d=%c\n", encoding, value, encoding); 5 | } 6 | 7 | static void generateStandardAlphabet() { 8 | printf("let StandardAlphabet : [UInt8] = [\n"); 9 | int i = 0; 10 | for(char c = 'A'; c <= 'Z'; ++c) { 11 | printEntry(c, i++); 12 | } 13 | for(char c = 'a'; c <= 'z'; ++c) { 14 | printEntry(c, i++); 15 | } 16 | for(char c = '0'; c <= '9'; ++c) { 17 | printEntry(c, i++); 18 | } 19 | printEntry('+', i++); 20 | printEntry('/', i++); 21 | printf("// PADDING FOLLOWS, not used during lookups\n"); 22 | printEntry('=', i++); 23 | printf("]\n"); 24 | } 25 | 26 | static void generateURLAndFilenameSafeAlphabet() { 27 | printf("let URLAndFilenameSafeAlphabet : [UInt8] = [\n"); 28 | int i = 0; 29 | for(char c = 'A'; c <= 'Z'; ++c) { 30 | printEntry(c, i++); 31 | } 32 | for(char c = 'a'; c <= 'z'; ++c) { 33 | printEntry(c, i++); 34 | } 35 | for(char c = '0'; c <= '9'; ++c) { 36 | printEntry(c, i++); 37 | } 38 | printEntry('-', i++); 39 | printEntry('_', i++); 40 | printf("// PADDING FOLLOWS, not used during lookups\n"); 41 | printEntry('=', i++); 42 | printf("]\n"); 43 | } 44 | 45 | int main() { 46 | generateStandardAlphabet(); 47 | printf("\n"); 48 | generateURLAndFilenameSafeAlphabet(); 49 | return 0; 50 | } 51 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # SwiftyBase64 2 | SwiftyBase64 provides base64url and base64 encoders as defined by 3 | [RFC 4648](https://tools.ietf.org/html/rfc4648). 4 | 5 | ## Usage 6 | 7 | ### Standard Base64 Encoding to String 8 | 9 | import SwiftyBase64 10 | ... 11 | let bytesToEncode : [UInt8] = [1,2,3] 12 | let base64EncodedString = SwiftyBase64.EncodeString(bytesToEncode) 13 | 14 | ### URL and Filename Safe Base64 Encoding to String 15 | 16 | import SwiftyBase64 17 | ... 18 | let bytesToEncode : [UInt8] = [1,2,3] 19 | let base64EncodedString = SwiftyBase64.EncodeString(bytesToEncode, alphabet:.URLAndFilenameSafe) 20 | 21 | ### Standard Base64 Encoding to [UInt8] of ASCII bytes 22 | 23 | import SwiftyBase64 24 | ... 25 | let bytesToEncode : [UInt8] = [1,2,3] 26 | let base64EncodedASCIIBytes = SwiftyBase64.Encode(bytesToEncode) 27 | 28 | ### URL and Filename Safe Base64 Encoding to [UInt8] of ASCII bytes 29 | 30 | import SwiftyBase64 31 | ... 32 | let bytesToEncode : [UInt8] = [1,2,3] 33 | let base64EncodedASCIIBytes = SwiftyBase64.Encode(bytesToEncode, alphabet:.URLAndFilenameSafe) 34 | 35 | 36 | ## CocoaPods Installation 37 | 38 | [CocoaPods](http://cocoapods.org) is a dependency manager for Cocoa projects. 39 | 40 | CocoaPods 0.36 adds supports for Swift and embedded frameworks. You can install it with the following command: 41 | 42 | ```bash 43 | $ gem install cocoapods 44 | ``` 45 | 46 | To integrate SwiftyBase64 into your Xcode project using CocoaPods, specify it in your `Podfile`: 47 | 48 | ```ruby 49 | use_frameworks! 50 | pod 'SwiftyBase64', '~> 1.0' 51 | ``` 52 | 53 | Then, run the following command: 54 | 55 | ```bash 56 | $ pod install 57 | ``` 58 | -------------------------------------------------------------------------------- /SwiftyBase64/Alphabets.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Alphabets.swift 3 | // SwiftyBase64 4 | // 5 | // Created by Doug Richardson on 8/7/15. 6 | // 7 | // 8 | 9 | // The tables in this file were generated using generate_alphabet_table in the tools directory. 10 | // Note the tables contain 65 characters: 64 to do the translation and 1 more for the padding 11 | // character used in each alphabet. 12 | 13 | /// Standard Base64 encoding table. 14 | let StandardAlphabet : [UInt8] = [ 15 | 65, // 0=A 16 | 66, // 1=B 17 | 67, // 2=C 18 | 68, // 3=D 19 | 69, // 4=E 20 | 70, // 5=F 21 | 71, // 6=G 22 | 72, // 7=H 23 | 73, // 8=I 24 | 74, // 9=J 25 | 75, // 10=K 26 | 76, // 11=L 27 | 77, // 12=M 28 | 78, // 13=N 29 | 79, // 14=O 30 | 80, // 15=P 31 | 81, // 16=Q 32 | 82, // 17=R 33 | 83, // 18=S 34 | 84, // 19=T 35 | 85, // 20=U 36 | 86, // 21=V 37 | 87, // 22=W 38 | 88, // 23=X 39 | 89, // 24=Y 40 | 90, // 25=Z 41 | 97, // 26=a 42 | 98, // 27=b 43 | 99, // 28=c 44 | 100, // 29=d 45 | 101, // 30=e 46 | 102, // 31=f 47 | 103, // 32=g 48 | 104, // 33=h 49 | 105, // 34=i 50 | 106, // 35=j 51 | 107, // 36=k 52 | 108, // 37=l 53 | 109, // 38=m 54 | 110, // 39=n 55 | 111, // 40=o 56 | 112, // 41=p 57 | 113, // 42=q 58 | 114, // 43=r 59 | 115, // 44=s 60 | 116, // 45=t 61 | 117, // 46=u 62 | 118, // 47=v 63 | 119, // 48=w 64 | 120, // 49=x 65 | 121, // 50=y 66 | 122, // 51=z 67 | 48, // 52=0 68 | 49, // 53=1 69 | 50, // 54=2 70 | 51, // 55=3 71 | 52, // 56=4 72 | 53, // 57=5 73 | 54, // 58=6 74 | 55, // 59=7 75 | 56, // 60=8 76 | 57, // 61=9 77 | 43, // 62=+ 78 | 47, // 63=/ 79 | // PADDING FOLLOWS, not used during lookups 80 | 61, // 64== 81 | ] 82 | 83 | /// URL and Filename Safe Base64 encoding table. 84 | let URLAndFilenameSafeAlphabet : [UInt8] = [ 85 | 65, // 0=A 86 | 66, // 1=B 87 | 67, // 2=C 88 | 68, // 3=D 89 | 69, // 4=E 90 | 70, // 5=F 91 | 71, // 6=G 92 | 72, // 7=H 93 | 73, // 8=I 94 | 74, // 9=J 95 | 75, // 10=K 96 | 76, // 11=L 97 | 77, // 12=M 98 | 78, // 13=N 99 | 79, // 14=O 100 | 80, // 15=P 101 | 81, // 16=Q 102 | 82, // 17=R 103 | 83, // 18=S 104 | 84, // 19=T 105 | 85, // 20=U 106 | 86, // 21=V 107 | 87, // 22=W 108 | 88, // 23=X 109 | 89, // 24=Y 110 | 90, // 25=Z 111 | 97, // 26=a 112 | 98, // 27=b 113 | 99, // 28=c 114 | 100, // 29=d 115 | 101, // 30=e 116 | 102, // 31=f 117 | 103, // 32=g 118 | 104, // 33=h 119 | 105, // 34=i 120 | 106, // 35=j 121 | 107, // 36=k 122 | 108, // 37=l 123 | 109, // 38=m 124 | 110, // 39=n 125 | 111, // 40=o 126 | 112, // 41=p 127 | 113, // 42=q 128 | 114, // 43=r 129 | 115, // 44=s 130 | 116, // 45=t 131 | 117, // 46=u 132 | 118, // 47=v 133 | 119, // 48=w 134 | 120, // 49=x 135 | 121, // 50=y 136 | 122, // 51=z 137 | 48, // 52=0 138 | 49, // 53=1 139 | 50, // 54=2 140 | 51, // 55=3 141 | 52, // 56=4 142 | 53, // 57=5 143 | 54, // 58=6 144 | 55, // 59=7 145 | 56, // 60=8 146 | 57, // 61=9 147 | 45, // 62=- 148 | 95, // 63=_ 149 | // PADDING FOLLOWS, not used during lookups 150 | 61, // 64== 151 | ] 152 | -------------------------------------------------------------------------------- /SwiftyBase64/Base64.swift: -------------------------------------------------------------------------------- 1 | // 2 | // Base64.swift 3 | // SwiftyBase64 4 | // 5 | // Created by Doug Richardson on 8/7/15. 6 | // 7 | // 8 | 9 | /** 10 | Base64 Alphabet to use during encoding. 11 | 12 | - Standard: The standard Base64 encoding, defined in RFC 4648 section 4. 13 | - URLAndFilenameSafe: The base64url encoding, defined in RFC 4648 section 5. 14 | */ 15 | public enum Alphabet { 16 | /// The standard Base64 alphabet 17 | case Standard 18 | 19 | /// The URL and Filename Safe Base64 alphabet 20 | case URLAndFilenameSafe 21 | } 22 | 23 | /** 24 | Encode a [UInt8] byte array as a Base64 String. 25 | 26 | - parameter bytes: Bytes to encode. 27 | - parameter alphabet: The Base64 alphabet to encode with. 28 | - returns: A String of the encoded bytes. 29 | */ 30 | public func EncodeString(_ bytes : [UInt8], alphabet : Alphabet = .Standard) -> String { 31 | let encoded = Encode(bytes, alphabet : alphabet) 32 | var result = String() 33 | for b in encoded { 34 | result.append(String(UnicodeScalar(b))) 35 | } 36 | return result 37 | } 38 | 39 | /// Get the encoding table for the alphabet. 40 | private func tableForAlphabet(_ alphabet : Alphabet) -> [UInt8] { 41 | switch alphabet { 42 | case .Standard: 43 | return StandardAlphabet 44 | case .URLAndFilenameSafe: 45 | return URLAndFilenameSafeAlphabet 46 | } 47 | } 48 | 49 | /** 50 | Use the Base64 algorithm as decribed by RFC 4648 section 4 to 51 | encode the input bytes. The alphabet specifies the translation 52 | table to use. RFC 4648 defines two such alphabets: 53 | 54 | - Standard (section 4) 55 | - URL and Filename Safe (section 5) 56 | 57 | - parameter bytes: Bytes to encode. 58 | - parameter alphabet: The Base64 alphabet to encode with. 59 | - returns: Base64 encoded ASCII bytes. 60 | */ 61 | public func Encode(_ bytes : [UInt8], alphabet : Alphabet = .Standard) -> [UInt8] { 62 | var encoded : [UInt8] = [] 63 | 64 | let table = tableForAlphabet(alphabet) 65 | let padding = table[64] 66 | 67 | var i = 0 68 | let count = bytes.count 69 | 70 | while i+3 <= count { 71 | let one = bytes[i] >> 2 72 | let two = ((bytes[i] & 0b11) << 4) | ((bytes[i+1] & 0b11110000) >> 4) 73 | let three = ((bytes[i+1] & 0b00001111) << 2) | ((bytes[i+2] & 0b11000000) >> 6) 74 | let four = bytes[i+2] & 0b00111111 75 | 76 | encoded.append(table[Int(one)]) 77 | encoded.append(table[Int(two)]) 78 | encoded.append(table[Int(three)]) 79 | encoded.append(table[Int(four)]) 80 | 81 | i += 3 82 | } 83 | 84 | if i+2 == count { 85 | // (3) The final quantum of encoding input is exactly 16 bits; here, the 86 | // final unit of encoded output will be three characters followed by 87 | // one "=" padding character. 88 | let one = bytes[i] >> 2 89 | let two = ((bytes[i] & 0b11) << 4) | ((bytes[i+1] & 0b11110000) >> 4) 90 | let three = ((bytes[i+1] & 0b00001111) << 2) 91 | encoded.append(table[Int(one)]) 92 | encoded.append(table[Int(two)]) 93 | encoded.append(table[Int(three)]) 94 | encoded.append(padding) 95 | } else if i+1 == count { 96 | // (2) The final quantum of encoding input is exactly 8 bits; here, the 97 | // final unit of encoded output will be two characters followed by 98 | // two "=" padding characters. 99 | let one = bytes[i] >> 2 100 | let two = ((bytes[i] & 0b11) << 4) 101 | encoded.append(table[Int(one)]) 102 | encoded.append(table[Int(two)]) 103 | encoded.append(padding) 104 | encoded.append(padding) 105 | } else { 106 | // (1) The final quantum of encoding input is an integral multiple of 24 107 | // bits; here, the final unit of encoded output will be an integral 108 | // multiple of 4 characters with no "=" padding. 109 | assert(i == count) 110 | } 111 | 112 | return encoded 113 | } 114 | -------------------------------------------------------------------------------- /SwiftyBase64Tests/SwiftyBase64Tests.swift: -------------------------------------------------------------------------------- 1 | // 2 | // SwiftyBase64Tests.swift 3 | // SwiftyBase64Tests 4 | // 5 | // Created by Doug Richardson on 8/7/15. 6 | // 7 | // 8 | 9 | import XCTest 10 | import SwiftyBase64 11 | 12 | class SwiftyBase64Tests: XCTestCase { 13 | 14 | // Test data generated using generate_binary_testfile.c like so: 15 | // gcc generate_binary_testfile.c && ./a.out | base64 16 | 17 | func testEmpty() { 18 | XCTAssertEqual(SwiftyBase64.EncodeString([]), "") 19 | XCTAssertEqual(SwiftyBase64.EncodeString([], alphabet:.URLAndFilenameSafe), "") 20 | } 21 | 22 | func testBase64OneByte() { 23 | XCTAssertEqual(SwiftyBase64.EncodeString([0]), "AA==") 24 | XCTAssertEqual(SwiftyBase64.EncodeString([0], alphabet:.URLAndFilenameSafe), "AA==") 25 | } 26 | 27 | func testBase64TwoBytes() { 28 | XCTAssertEqual(SwiftyBase64.EncodeString([0,0]), "AAA=") 29 | XCTAssertEqual(SwiftyBase64.EncodeString([0,0], alphabet:.URLAndFilenameSafe), "AAA=") 30 | } 31 | 32 | func testBase64ThreeBytes() { 33 | XCTAssertEqual(SwiftyBase64.EncodeString([0,0,0]), "AAAA") 34 | XCTAssertEqual(SwiftyBase64.EncodeString([0,0,0], alphabet:.URLAndFilenameSafe), "AAAA") 35 | } 36 | 37 | func test255() { 38 | XCTAssertEqual(SwiftyBase64.EncodeString([255]), "/w==") 39 | XCTAssertEqual(SwiftyBase64.EncodeString([255], alphabet:.URLAndFilenameSafe), "_w==") 40 | } 41 | 42 | func test254Thru255() { 43 | XCTAssertEqual(SwiftyBase64.EncodeString([254, 255]), "/v8=") 44 | XCTAssertEqual(SwiftyBase64.EncodeString([254, 255], alphabet:.URLAndFilenameSafe), "_v8=") 45 | } 46 | 47 | func testZeroThrough255() { 48 | // generated with generate_binary_testfile.c and base64 command line tool. 49 | let expectedStandard = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0+P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn+AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq+wsbKztLW2t7i5uru8vb6/wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t/g4eLj5OXm5+jp6uvs7e7v8PHy8/T19vf4+fr7/P3+/w==" 50 | let expectedURLSafe = "AAECAwQFBgcICQoLDA0ODxAREhMUFRYXGBkaGxwdHh8gISIjJCUmJygpKissLS4vMDEyMzQ1Njc4OTo7PD0-P0BBQkNERUZHSElKS0xNTk9QUVJTVFVWV1hZWltcXV5fYGFiY2RlZmdoaWprbG1ub3BxcnN0dXZ3eHl6e3x9fn-AgYKDhIWGh4iJiouMjY6PkJGSk5SVlpeYmZqbnJ2en6ChoqOkpaanqKmqq6ytrq-wsbKztLW2t7i5uru8vb6_wMHCw8TFxsfIycrLzM3Oz9DR0tPU1dbX2Nna29zd3t_g4eLj5OXm5-jp6uvs7e7v8PHy8_T19vf4-fr7_P3-_w==" 51 | 52 | var b = [UInt8]() 53 | for i in 0...255 { 54 | b.append(UInt8(i)) 55 | } 56 | 57 | XCTAssertEqual(SwiftyBase64.EncodeString(b), expectedStandard) 58 | XCTAssertEqual(SwiftyBase64.EncodeString(b, alphabet:.URLAndFilenameSafe), expectedURLSafe) 59 | } 60 | 61 | func testOneThrough255() { 62 | // generated with generate_binary_testfile.c and base64 command line tool. 63 | let expectedStandard = "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4/QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1+f4CBgoOEhYaHiImKi4yNjo+QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr/AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3+Dh4uPk5ebn6Onq6+zt7u/w8fLz9PX29/j5+vv8/f7/" 64 | let expectedURLSafe = "AQIDBAUGBwgJCgsMDQ4PEBESExQVFhcYGRobHB0eHyAhIiMkJSYnKCkqKywtLi8wMTIzNDU2Nzg5Ojs8PT4_QEFCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaW1xdXl9gYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXp7fH1-f4CBgoOEhYaHiImKi4yNjo-QkZKTlJWWl5iZmpucnZ6foKGio6SlpqeoqaqrrK2ur7CxsrO0tba3uLm6u7y9vr_AwcLDxMXGx8jJysvMzc7P0NHS09TV1tfY2drb3N3e3-Dh4uPk5ebn6Onq6-zt7u_w8fLz9PX29_j5-vv8_f7_" 65 | 66 | var b = [UInt8]() 67 | for i in 1...255 { 68 | b.append(UInt8(i)) 69 | } 70 | 71 | XCTAssertEqual(SwiftyBase64.EncodeString(b), expectedStandard) 72 | XCTAssertEqual(SwiftyBase64.EncodeString(b, alphabet:.URLAndFilenameSafe), expectedURLSafe) 73 | } 74 | 75 | func testTwoThrough255() { 76 | // generated with generate_binary_testfile.c and base64 command line tool. 77 | let expectedStandard = "AgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5/gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp+goaKjpKWmp6ipqqusra6vsLGys7S1tre4ubq7vL2+v8DBwsPExcbHyMnKy8zNzs/Q0dLT1NXW19jZ2tvc3d7f4OHi4+Tl5ufo6err7O3u7/Dx8vP09fb3+Pn6+/z9/v8=" 78 | let expectedURLSafe = "AgMEBQYHCAkKCwwNDg8QERITFBUWFxgZGhscHR4fICEiIyQlJicoKSorLC0uLzAxMjM0NTY3ODk6Ozw9Pj9AQUJDREVGR0hJSktMTU5PUFFSU1RVVldYWVpbXF1eX2BhYmNkZWZnaGlqa2xtbm9wcXJzdHV2d3h5ent8fX5_gIGCg4SFhoeIiYqLjI2Oj5CRkpOUlZaXmJmam5ydnp-goaKjpKWmp6ipqqusra6vsLGys7S1tre4ubq7vL2-v8DBwsPExcbHyMnKy8zNzs_Q0dLT1NXW19jZ2tvc3d7f4OHi4-Tl5ufo6err7O3u7_Dx8vP09fb3-Pn6-_z9_v8=" 79 | 80 | var b = [UInt8]() 81 | for i in 2...255 { 82 | b.append(UInt8(i)) 83 | } 84 | 85 | XCTAssertEqual(SwiftyBase64.EncodeString(b), expectedStandard) 86 | XCTAssertEqual(SwiftyBase64.EncodeString(b, alphabet:.URLAndFilenameSafe), expectedURLSafe) 87 | } 88 | 89 | func testPerformanceBase64() { 90 | var b = [UInt8]() 91 | for i in 0...(50*1024) { 92 | b.append(UInt8(i % 256)) 93 | } 94 | 95 | self.measure() { 96 | _ = SwiftyBase64.Encode(b) 97 | } 98 | } 99 | 100 | } 101 | -------------------------------------------------------------------------------- /SwiftyBase64.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXBuildFile section */ 10 | 9141D5C61B757AA6008208DF /* SwiftyBase64.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9141D5BA1B757AA6008208DF /* SwiftyBase64.framework */; }; 11 | 9141D5CD1B757AA6008208DF /* SwiftyBase64Tests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9141D5CC1B757AA6008208DF /* SwiftyBase64Tests.swift */; }; 12 | 9141D5D71B757AB5008208DF /* Base64.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9141D5D61B757AB5008208DF /* Base64.swift */; }; 13 | 9141D5D91B7591DD008208DF /* Alphabets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9141D5D81B7591DD008208DF /* Alphabets.swift */; }; 14 | /* End PBXBuildFile section */ 15 | 16 | /* Begin PBXContainerItemProxy section */ 17 | 9141D5C71B757AA6008208DF /* PBXContainerItemProxy */ = { 18 | isa = PBXContainerItemProxy; 19 | containerPortal = 9141D5B11B757AA5008208DF /* Project object */; 20 | proxyType = 1; 21 | remoteGlobalIDString = 9141D5B91B757AA6008208DF; 22 | remoteInfo = SwiftyBase64; 23 | }; 24 | /* End PBXContainerItemProxy section */ 25 | 26 | /* Begin PBXFileReference section */ 27 | 9141D5BA1B757AA6008208DF /* SwiftyBase64.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftyBase64.framework; sourceTree = BUILT_PRODUCTS_DIR; }; 28 | 9141D5BE1B757AA6008208DF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 29 | 9141D5C51B757AA6008208DF /* SwiftyBase64Tests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = SwiftyBase64Tests.xctest; sourceTree = BUILT_PRODUCTS_DIR; }; 30 | 9141D5CB1B757AA6008208DF /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 31 | 9141D5CC1B757AA6008208DF /* SwiftyBase64Tests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SwiftyBase64Tests.swift; sourceTree = ""; }; 32 | 9141D5D61B757AB5008208DF /* Base64.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Base64.swift; sourceTree = ""; }; 33 | 9141D5D81B7591DD008208DF /* Alphabets.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Alphabets.swift; sourceTree = ""; }; 34 | /* End PBXFileReference section */ 35 | 36 | /* Begin PBXFrameworksBuildPhase section */ 37 | 9141D5B61B757AA6008208DF /* Frameworks */ = { 38 | isa = PBXFrameworksBuildPhase; 39 | buildActionMask = 2147483647; 40 | files = ( 41 | ); 42 | runOnlyForDeploymentPostprocessing = 0; 43 | }; 44 | 9141D5C21B757AA6008208DF /* Frameworks */ = { 45 | isa = PBXFrameworksBuildPhase; 46 | buildActionMask = 2147483647; 47 | files = ( 48 | 9141D5C61B757AA6008208DF /* SwiftyBase64.framework in Frameworks */, 49 | ); 50 | runOnlyForDeploymentPostprocessing = 0; 51 | }; 52 | /* End PBXFrameworksBuildPhase section */ 53 | 54 | /* Begin PBXGroup section */ 55 | 9141D5B01B757AA5008208DF = { 56 | isa = PBXGroup; 57 | children = ( 58 | 9141D5BC1B757AA6008208DF /* SwiftyBase64 */, 59 | 9141D5C91B757AA6008208DF /* SwiftyBase64Tests */, 60 | 9141D5BB1B757AA6008208DF /* Products */, 61 | ); 62 | sourceTree = ""; 63 | }; 64 | 9141D5BB1B757AA6008208DF /* Products */ = { 65 | isa = PBXGroup; 66 | children = ( 67 | 9141D5BA1B757AA6008208DF /* SwiftyBase64.framework */, 68 | 9141D5C51B757AA6008208DF /* SwiftyBase64Tests.xctest */, 69 | ); 70 | name = Products; 71 | sourceTree = ""; 72 | }; 73 | 9141D5BC1B757AA6008208DF /* SwiftyBase64 */ = { 74 | isa = PBXGroup; 75 | children = ( 76 | 9141D5D81B7591DD008208DF /* Alphabets.swift */, 77 | 9141D5D61B757AB5008208DF /* Base64.swift */, 78 | 9141D5BD1B757AA6008208DF /* Supporting Files */, 79 | ); 80 | path = SwiftyBase64; 81 | sourceTree = ""; 82 | }; 83 | 9141D5BD1B757AA6008208DF /* Supporting Files */ = { 84 | isa = PBXGroup; 85 | children = ( 86 | 9141D5BE1B757AA6008208DF /* Info.plist */, 87 | ); 88 | name = "Supporting Files"; 89 | sourceTree = ""; 90 | }; 91 | 9141D5C91B757AA6008208DF /* SwiftyBase64Tests */ = { 92 | isa = PBXGroup; 93 | children = ( 94 | 9141D5CC1B757AA6008208DF /* SwiftyBase64Tests.swift */, 95 | 9141D5CA1B757AA6008208DF /* Supporting Files */, 96 | ); 97 | path = SwiftyBase64Tests; 98 | sourceTree = ""; 99 | }; 100 | 9141D5CA1B757AA6008208DF /* Supporting Files */ = { 101 | isa = PBXGroup; 102 | children = ( 103 | 9141D5CB1B757AA6008208DF /* Info.plist */, 104 | ); 105 | name = "Supporting Files"; 106 | sourceTree = ""; 107 | }; 108 | /* End PBXGroup section */ 109 | 110 | /* Begin PBXHeadersBuildPhase section */ 111 | 9141D5B71B757AA6008208DF /* Headers */ = { 112 | isa = PBXHeadersBuildPhase; 113 | buildActionMask = 2147483647; 114 | files = ( 115 | ); 116 | runOnlyForDeploymentPostprocessing = 0; 117 | }; 118 | /* End PBXHeadersBuildPhase section */ 119 | 120 | /* Begin PBXNativeTarget section */ 121 | 9141D5B91B757AA6008208DF /* SwiftyBase64 */ = { 122 | isa = PBXNativeTarget; 123 | buildConfigurationList = 9141D5D01B757AA6008208DF /* Build configuration list for PBXNativeTarget "SwiftyBase64" */; 124 | buildPhases = ( 125 | 9141D5B51B757AA6008208DF /* Sources */, 126 | 9141D5B61B757AA6008208DF /* Frameworks */, 127 | 9141D5B71B757AA6008208DF /* Headers */, 128 | 9141D5B81B757AA6008208DF /* Resources */, 129 | ); 130 | buildRules = ( 131 | ); 132 | dependencies = ( 133 | ); 134 | name = SwiftyBase64; 135 | productName = SwiftyBase64; 136 | productReference = 9141D5BA1B757AA6008208DF /* SwiftyBase64.framework */; 137 | productType = "com.apple.product-type.framework"; 138 | }; 139 | 9141D5C41B757AA6008208DF /* SwiftyBase64Tests */ = { 140 | isa = PBXNativeTarget; 141 | buildConfigurationList = 9141D5D31B757AA6008208DF /* Build configuration list for PBXNativeTarget "SwiftyBase64Tests" */; 142 | buildPhases = ( 143 | 9141D5C11B757AA6008208DF /* Sources */, 144 | 9141D5C21B757AA6008208DF /* Frameworks */, 145 | 9141D5C31B757AA6008208DF /* Resources */, 146 | ); 147 | buildRules = ( 148 | ); 149 | dependencies = ( 150 | 9141D5C81B757AA6008208DF /* PBXTargetDependency */, 151 | ); 152 | name = SwiftyBase64Tests; 153 | productName = SwiftyBase64Tests; 154 | productReference = 9141D5C51B757AA6008208DF /* SwiftyBase64Tests.xctest */; 155 | productType = "com.apple.product-type.bundle.unit-test"; 156 | }; 157 | /* End PBXNativeTarget section */ 158 | 159 | /* Begin PBXProject section */ 160 | 9141D5B11B757AA5008208DF /* Project object */ = { 161 | isa = PBXProject; 162 | attributes = { 163 | LastSwiftMigration = 0700; 164 | LastSwiftUpdateCheck = 0700; 165 | LastUpgradeCheck = 0800; 166 | TargetAttributes = { 167 | 9141D5B91B757AA6008208DF = { 168 | CreatedOnToolsVersion = 6.4; 169 | LastSwiftMigration = 0800; 170 | }; 171 | 9141D5C41B757AA6008208DF = { 172 | CreatedOnToolsVersion = 6.4; 173 | LastSwiftMigration = 0800; 174 | }; 175 | }; 176 | }; 177 | buildConfigurationList = 9141D5B41B757AA5008208DF /* Build configuration list for PBXProject "SwiftyBase64" */; 178 | compatibilityVersion = "Xcode 3.2"; 179 | developmentRegion = English; 180 | hasScannedForEncodings = 0; 181 | knownRegions = ( 182 | en, 183 | ); 184 | mainGroup = 9141D5B01B757AA5008208DF; 185 | productRefGroup = 9141D5BB1B757AA6008208DF /* Products */; 186 | projectDirPath = ""; 187 | projectRoot = ""; 188 | targets = ( 189 | 9141D5B91B757AA6008208DF /* SwiftyBase64 */, 190 | 9141D5C41B757AA6008208DF /* SwiftyBase64Tests */, 191 | ); 192 | }; 193 | /* End PBXProject section */ 194 | 195 | /* Begin PBXResourcesBuildPhase section */ 196 | 9141D5B81B757AA6008208DF /* Resources */ = { 197 | isa = PBXResourcesBuildPhase; 198 | buildActionMask = 2147483647; 199 | files = ( 200 | ); 201 | runOnlyForDeploymentPostprocessing = 0; 202 | }; 203 | 9141D5C31B757AA6008208DF /* Resources */ = { 204 | isa = PBXResourcesBuildPhase; 205 | buildActionMask = 2147483647; 206 | files = ( 207 | ); 208 | runOnlyForDeploymentPostprocessing = 0; 209 | }; 210 | /* End PBXResourcesBuildPhase section */ 211 | 212 | /* Begin PBXSourcesBuildPhase section */ 213 | 9141D5B51B757AA6008208DF /* Sources */ = { 214 | isa = PBXSourcesBuildPhase; 215 | buildActionMask = 2147483647; 216 | files = ( 217 | 9141D5D71B757AB5008208DF /* Base64.swift in Sources */, 218 | 9141D5D91B7591DD008208DF /* Alphabets.swift in Sources */, 219 | ); 220 | runOnlyForDeploymentPostprocessing = 0; 221 | }; 222 | 9141D5C11B757AA6008208DF /* Sources */ = { 223 | isa = PBXSourcesBuildPhase; 224 | buildActionMask = 2147483647; 225 | files = ( 226 | 9141D5CD1B757AA6008208DF /* SwiftyBase64Tests.swift in Sources */, 227 | ); 228 | runOnlyForDeploymentPostprocessing = 0; 229 | }; 230 | /* End PBXSourcesBuildPhase section */ 231 | 232 | /* Begin PBXTargetDependency section */ 233 | 9141D5C81B757AA6008208DF /* PBXTargetDependency */ = { 234 | isa = PBXTargetDependency; 235 | target = 9141D5B91B757AA6008208DF /* SwiftyBase64 */; 236 | targetProxy = 9141D5C71B757AA6008208DF /* PBXContainerItemProxy */; 237 | }; 238 | /* End PBXTargetDependency section */ 239 | 240 | /* Begin XCBuildConfiguration section */ 241 | 9141D5CE1B757AA6008208DF /* Debug */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | ALWAYS_SEARCH_USER_PATHS = NO; 245 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 246 | CLANG_CXX_LIBRARY = "libc++"; 247 | CLANG_ENABLE_MODULES = YES; 248 | CLANG_ENABLE_OBJC_ARC = YES; 249 | CLANG_WARN_BOOL_CONVERSION = YES; 250 | CLANG_WARN_CONSTANT_CONVERSION = YES; 251 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 252 | CLANG_WARN_EMPTY_BODY = YES; 253 | CLANG_WARN_ENUM_CONVERSION = YES; 254 | CLANG_WARN_INFINITE_RECURSION = YES; 255 | CLANG_WARN_INT_CONVERSION = YES; 256 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 257 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 258 | CLANG_WARN_UNREACHABLE_CODE = YES; 259 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 260 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 261 | COPY_PHASE_STRIP = NO; 262 | CURRENT_PROJECT_VERSION = 1; 263 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 264 | ENABLE_STRICT_OBJC_MSGSEND = YES; 265 | ENABLE_TESTABILITY = YES; 266 | GCC_DYNAMIC_NO_PIC = NO; 267 | GCC_NO_COMMON_BLOCKS = YES; 268 | GCC_OPTIMIZATION_LEVEL = 0; 269 | GCC_PREPROCESSOR_DEFINITIONS = ( 270 | "DEBUG=1", 271 | "$(inherited)", 272 | ); 273 | GCC_SYMBOLS_PRIVATE_EXTERN = NO; 274 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 275 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 276 | GCC_WARN_UNDECLARED_SELECTOR = YES; 277 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 278 | GCC_WARN_UNUSED_FUNCTION = YES; 279 | GCC_WARN_UNUSED_VARIABLE = YES; 280 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 281 | MTL_ENABLE_DEBUG_INFO = YES; 282 | ONLY_ACTIVE_ARCH = YES; 283 | SDKROOT = iphoneos; 284 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 285 | TARGETED_DEVICE_FAMILY = "1,2"; 286 | VERSIONING_SYSTEM = "apple-generic"; 287 | VERSION_INFO_PREFIX = ""; 288 | }; 289 | name = Debug; 290 | }; 291 | 9141D5CF1B757AA6008208DF /* Release */ = { 292 | isa = XCBuildConfiguration; 293 | buildSettings = { 294 | ALWAYS_SEARCH_USER_PATHS = NO; 295 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x"; 296 | CLANG_CXX_LIBRARY = "libc++"; 297 | CLANG_ENABLE_MODULES = YES; 298 | CLANG_ENABLE_OBJC_ARC = YES; 299 | CLANG_WARN_BOOL_CONVERSION = YES; 300 | CLANG_WARN_CONSTANT_CONVERSION = YES; 301 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR; 302 | CLANG_WARN_EMPTY_BODY = YES; 303 | CLANG_WARN_ENUM_CONVERSION = YES; 304 | CLANG_WARN_INFINITE_RECURSION = YES; 305 | CLANG_WARN_INT_CONVERSION = YES; 306 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR; 307 | CLANG_WARN_SUSPICIOUS_MOVE = YES; 308 | CLANG_WARN_UNREACHABLE_CODE = YES; 309 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; 310 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; 311 | COPY_PHASE_STRIP = NO; 312 | CURRENT_PROJECT_VERSION = 1; 313 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; 314 | ENABLE_NS_ASSERTIONS = NO; 315 | ENABLE_STRICT_OBJC_MSGSEND = YES; 316 | GCC_NO_COMMON_BLOCKS = YES; 317 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES; 318 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR; 319 | GCC_WARN_UNDECLARED_SELECTOR = YES; 320 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; 321 | GCC_WARN_UNUSED_FUNCTION = YES; 322 | GCC_WARN_UNUSED_VARIABLE = YES; 323 | IPHONEOS_DEPLOYMENT_TARGET = 8.4; 324 | MTL_ENABLE_DEBUG_INFO = NO; 325 | SDKROOT = iphoneos; 326 | SWIFT_OPTIMIZATION_LEVEL = "-Owholemodule"; 327 | TARGETED_DEVICE_FAMILY = "1,2"; 328 | VALIDATE_PRODUCT = YES; 329 | VERSIONING_SYSTEM = "apple-generic"; 330 | VERSION_INFO_PREFIX = ""; 331 | }; 332 | name = Release; 333 | }; 334 | 9141D5D11B757AA6008208DF /* Debug */ = { 335 | isa = XCBuildConfiguration; 336 | buildSettings = { 337 | CLANG_ENABLE_MODULES = YES; 338 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 339 | DEFINES_MODULE = YES; 340 | DYLIB_COMPATIBILITY_VERSION = 1; 341 | DYLIB_CURRENT_VERSION = 1; 342 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 343 | INFOPLIST_FILE = SwiftyBase64/Info.plist; 344 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 345 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.drichardson.$(PRODUCT_NAME:rfc1034identifier)"; 346 | PRODUCT_NAME = "$(TARGET_NAME)"; 347 | SKIP_INSTALL = YES; 348 | SWIFT_OPTIMIZATION_LEVEL = "-Onone"; 349 | SWIFT_VERSION = 3.0; 350 | }; 351 | name = Debug; 352 | }; 353 | 9141D5D21B757AA6008208DF /* Release */ = { 354 | isa = XCBuildConfiguration; 355 | buildSettings = { 356 | CLANG_ENABLE_MODULES = YES; 357 | "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = ""; 358 | DEFINES_MODULE = YES; 359 | DYLIB_COMPATIBILITY_VERSION = 1; 360 | DYLIB_CURRENT_VERSION = 1; 361 | DYLIB_INSTALL_NAME_BASE = "@rpath"; 362 | INFOPLIST_FILE = SwiftyBase64/Info.plist; 363 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 364 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.drichardson.$(PRODUCT_NAME:rfc1034identifier)"; 365 | PRODUCT_NAME = "$(TARGET_NAME)"; 366 | SKIP_INSTALL = YES; 367 | SWIFT_VERSION = 3.0; 368 | }; 369 | name = Release; 370 | }; 371 | 9141D5D41B757AA6008208DF /* Debug */ = { 372 | isa = XCBuildConfiguration; 373 | buildSettings = { 374 | GCC_PREPROCESSOR_DEFINITIONS = ( 375 | "DEBUG=1", 376 | "$(inherited)", 377 | ); 378 | INFOPLIST_FILE = SwiftyBase64Tests/Info.plist; 379 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 380 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.drichardson.$(PRODUCT_NAME:rfc1034identifier)"; 381 | PRODUCT_NAME = "$(TARGET_NAME)"; 382 | SWIFT_VERSION = 3.0; 383 | }; 384 | name = Debug; 385 | }; 386 | 9141D5D51B757AA6008208DF /* Release */ = { 387 | isa = XCBuildConfiguration; 388 | buildSettings = { 389 | INFOPLIST_FILE = SwiftyBase64Tests/Info.plist; 390 | LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks"; 391 | PRODUCT_BUNDLE_IDENTIFIER = "com.github.drichardson.$(PRODUCT_NAME:rfc1034identifier)"; 392 | PRODUCT_NAME = "$(TARGET_NAME)"; 393 | SWIFT_VERSION = 3.0; 394 | }; 395 | name = Release; 396 | }; 397 | /* End XCBuildConfiguration section */ 398 | 399 | /* Begin XCConfigurationList section */ 400 | 9141D5B41B757AA5008208DF /* Build configuration list for PBXProject "SwiftyBase64" */ = { 401 | isa = XCConfigurationList; 402 | buildConfigurations = ( 403 | 9141D5CE1B757AA6008208DF /* Debug */, 404 | 9141D5CF1B757AA6008208DF /* Release */, 405 | ); 406 | defaultConfigurationIsVisible = 0; 407 | defaultConfigurationName = Release; 408 | }; 409 | 9141D5D01B757AA6008208DF /* Build configuration list for PBXNativeTarget "SwiftyBase64" */ = { 410 | isa = XCConfigurationList; 411 | buildConfigurations = ( 412 | 9141D5D11B757AA6008208DF /* Debug */, 413 | 9141D5D21B757AA6008208DF /* Release */, 414 | ); 415 | defaultConfigurationIsVisible = 0; 416 | defaultConfigurationName = Release; 417 | }; 418 | 9141D5D31B757AA6008208DF /* Build configuration list for PBXNativeTarget "SwiftyBase64Tests" */ = { 419 | isa = XCConfigurationList; 420 | buildConfigurations = ( 421 | 9141D5D41B757AA6008208DF /* Debug */, 422 | 9141D5D51B757AA6008208DF /* Release */, 423 | ); 424 | defaultConfigurationIsVisible = 0; 425 | defaultConfigurationName = Release; 426 | }; 427 | /* End XCConfigurationList section */ 428 | }; 429 | rootObject = 9141D5B11B757AA5008208DF /* Project object */; 430 | } 431 | --------------------------------------------------------------------------------