├── .gitignore ├── COPYING ├── Math ├── gcd │ ├── gcd.c │ ├── gcd.h │ ├── gcd.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── gcd.xccheckout │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── gcd.a.xcscheme │ │ │ └── xcschememanagement.plist │ └── t │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch └── lcm │ ├── lcm.c │ ├── lcm.h │ ├── lcm.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── lcm.xccheckout │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ ├── rnix.perspectivev3 │ └── xcuserdata │ │ └── rnix.xcuserdatad │ │ └── xcschemes │ │ ├── lcm.a.xcscheme │ │ └── xcschememanagement.plist │ └── t │ ├── t.m │ ├── t.xcodeproj │ ├── project.pbxproj │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ ├── rnix.perspectivev3 │ └── xcuserdata │ │ └── rnix.xcuserdatad │ │ └── xcschemes │ │ ├── t.xcscheme │ │ └── xcschememanagement.plist │ └── t_Prefix.pch ├── NSData ├── NSData+AES │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSData+AES.h │ ├── NSData+AES.m │ ├── NSData+AES.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── NSData+AES.xccheckout │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── NSData+AES.xcscheme │ │ │ ├── NSDataAES.xcscheme │ │ │ ├── SHA256AES.xcscheme │ │ │ ├── aes.xcscheme │ │ │ └── xcschememanagement.plist │ ├── NSData+AESKey.h │ ├── NSData+AESKey.m │ ├── NSData+AESValue.h │ ├── NSData+AESValue.m │ ├── NSData+AES_Prefix.pch │ ├── NSMutableData+AES.h │ ├── NSMutableData+AES.m │ ├── cipher.h │ ├── cipher.m │ ├── main.h │ ├── main.m │ └── t │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Unit Tests.xcscheme │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch ├── NSData+Adler32 │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSData+Adler32.h │ ├── NSData+Adler32.m │ ├── NSData+Adler32.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── NSData+Adler32.xccheckout │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ └── rnix.perspectivev3 │ ├── NSData+Adler32_Prefix.pch │ ├── main.h │ ├── main.m │ └── t │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ └── rnix.perspectivev3 │ │ └── t_Prefix.pch ├── NSData+Output │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSData+Output.h │ ├── NSData+Output.m │ ├── NSData+Output.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── NSData+Output.xccheckout │ │ │ └── xcuserdata │ │ │ │ └── rnix.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ └── WorkspaceSettings.xcsettings │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── NSData+Output.xcscheme │ │ │ ├── NSDataOutput.xcscheme │ │ │ └── xcschememanagement.plist │ ├── NSData+Output_Prefix.pch │ ├── main.h │ ├── main.m │ └── t │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Unit Tests.xcscheme │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch └── NSData+stringAsBase │ ├── English.lproj │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSData+stringAsBase.h │ ├── NSData+stringAsBase.m │ ├── NSData+stringAsBase.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── NSData+stringAsBase.xccheckout │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ ├── rnix.perspectivev3 │ └── xcuserdata │ │ └── rnix.xcuserdatad │ │ └── xcschemes │ │ ├── NSData+stringAsBase.xcscheme │ │ └── xcschememanagement.plist │ ├── NSData+stringAsBase_Prefix.pch │ ├── anybase.c │ └── t │ ├── Unit Tests-Info.plist │ ├── t.m │ ├── t.xcodeproj │ ├── project.pbxproj │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ ├── rnix.perspectivev3 │ └── xcuserdata │ │ └── rnix.xcuserdatad │ │ └── xcschemes │ │ ├── Unit Tests.xcscheme │ │ ├── t.xcscheme │ │ └── xcschememanagement.plist │ └── t_Prefix.pch ├── NSString ├── NSString+AES │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSString+AES.h │ ├── NSString+AES.m │ ├── NSString+AES.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── NSString+AES.xccheckout │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── NSString+AES.xcscheme │ │ │ ├── NSStringAES.xcscheme │ │ │ ├── aes.xcscheme │ │ │ └── xcschememanagement.plist │ ├── NSString+AES_Prefix.pch │ ├── main.h │ ├── main.m │ └── t │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Unit Tests.xcscheme │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch ├── NSString+Adler32 │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSString+Adler32.h │ ├── NSString+Adler32.m │ ├── NSString+Adler32.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── NSString+Adler32.xccheckout │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ └── rnix.perspectivev3 │ ├── NSString+Adler32_Prefix.pch │ ├── main.h │ ├── main.m │ └── t │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ └── rnix.perspectivev3 │ │ └── t_Prefix.pch ├── NSString+stringAsBase │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSString+stringAsBase.h │ ├── NSString+stringAsBase.m │ ├── NSString+stringAsBase.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── NSString+stringAsBase.xccheckout │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── NSString+stringAsBase.xcscheme │ │ │ └── xcschememanagement.plist │ ├── NSString+stringAsBase_Prefix.pch │ └── t │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Unit Tests.xcscheme │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch └── NSString+stringAsReverseString │ ├── English.lproj │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSString+stringAsReverseString.h │ ├── NSString+stringAsReverseString.m │ ├── NSString+stringAsReverseString.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── NSString+stringAsReverseString.xccheckout │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ ├── rnix.perspectivev3 │ └── xcuserdata │ │ └── rnix.xcuserdatad │ │ └── xcschemes │ │ ├── NSString+stringAsReverseString.xcscheme │ │ └── xcschememanagement.plist │ ├── NSString+stringAsReverseString_Prefix.pch │ └── t │ ├── Unit Tests-Info.plist │ ├── t.m │ ├── t.xcodeproj │ ├── project.pbxproj │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ ├── rnix.perspectivev3 │ └── xcuserdata │ │ └── rnix.xcuserdatad │ │ └── xcschemes │ │ ├── Unit Tests.xcscheme │ │ ├── t.xcscheme │ │ └── xcschememanagement.plist │ └── t_Prefix.pch ├── NSURL └── NSURL+Bug8840060Fix │ ├── English.lproj │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSURL+Bug8840060Fix.h │ ├── NSURL+Bug8840060Fix.m │ ├── NSURL+Bug8840060Fix.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── NSURL+Bug8840060Fix.xccheckout │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ └── rnix.perspectivev3 │ ├── NSURL+Bug8840060Fix_Prefix.pch │ └── t │ ├── Unit Tests-Info.plist │ ├── t.m │ ├── t.xcodeproj │ ├── project.pbxproj │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ └── rnix.perspectivev3 │ └── t_Prefix.pch ├── README.md ├── Util ├── Adler-32 │ ├── Adler-32.c │ ├── Adler-32.h │ ├── Adler-32.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── Adler-32.xccheckout │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Adler-32.a.xcscheme │ │ │ ├── adler.xcscheme │ │ │ └── xcschememanagement.plist │ ├── Adler-32_Prefix.pch │ ├── main.h │ ├── main.m │ └── t │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch ├── BaseCharacters │ ├── BaseCharacters.h │ ├── BaseCharacters.m │ ├── BaseCharacters.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── BaseCharacters.xccheckout │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── BaseCharacters.xcscheme │ │ │ └── xcschememanagement.plist │ ├── BaseCharacters_Prefix.pch │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ └── t │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── Unit Tests.xcscheme │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch ├── CommandLine │ ├── Argument.h │ ├── Argument.m │ ├── CommandLine.h │ ├── CommandLine.m │ ├── CommandLine.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ └── xcshareddata │ │ │ │ └── CommandLine.xccheckout │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ └── rnix.perspectivev3 │ ├── CommandLine_Prefix.pch │ ├── English.lproj │ │ └── InfoPlist.strings │ ├── Info.plist │ ├── NSArray+charactersFromString.h │ ├── NSArray+charactersFromString.m │ ├── Option.h │ ├── Option.m │ ├── Parameter.h │ ├── Parameter.m │ └── t │ │ ├── TestOptions.h │ │ ├── TestOptions.m │ │ ├── Unit Tests-Info.plist │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ └── rnix.perspectivev3 │ │ └── t_Prefix.pch ├── jrand │ ├── JRandom.h │ ├── JRandom.m │ ├── jRandom │ │ └── jRandom-Prefix.pch │ ├── jrand.c │ ├── jrand.h │ ├── jrand.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── jrand.xccheckout │ │ │ └── xcuserdata │ │ │ │ └── rnix.xcuserdatad │ │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ │ └── WorkspaceSettings.xcsettings │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ └── xcschemes │ │ │ ├── jRandom.xcscheme │ │ │ ├── jrand.a.xcscheme │ │ │ └── xcschememanagement.plist │ ├── jrand.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── WorkspaceSettings.xcsettings │ └── t │ │ ├── t.java │ │ ├── t.m │ │ ├── t.xcodeproj │ │ ├── project.pbxproj │ │ ├── rnix.mode1v3 │ │ ├── rnix.pbxuser │ │ ├── rnix.perspectivev3 │ │ └── xcuserdata │ │ │ └── rnix.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── t.class.xcscheme │ │ │ ├── t.xcscheme │ │ │ └── xcschememanagement.plist │ │ └── t_Prefix.pch └── swap │ ├── swap.c │ ├── swap.h │ ├── swap.xcodeproj │ ├── project.pbxproj │ ├── project.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcshareddata │ │ │ └── swap.xccheckout │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ └── rnix.perspectivev3 │ └── t │ ├── t.m │ ├── t.xcodeproj │ ├── project.pbxproj │ ├── rnix.mode1v3 │ ├── rnix.pbxuser │ └── rnix.perspectivev3 │ └── t_Prefix.pch └── obj.xcworkspace └── contents.xcworkspacedata /.gitignore: -------------------------------------------------------------------------------- 1 | .*~ 2 | xcuserdata/ 3 | *.xcuserstate 4 | *google1c4578d9e62c4dc6* 5 | .hg* 6 | .svn/ 7 | build/ 8 | dist/ 9 | propertylist/ 10 | altova/ 11 | private/ 12 | target/ 13 | classes/ 14 | test-classes/ 15 | .manager/ 16 | .synapse 17 | index.md 18 | todo.md 19 | .settings 20 | .project 21 | .classpath 22 | *.1 23 | *.class 24 | *.pyc 25 | *.jar 26 | *.zip 27 | *.tar 28 | *.rar 29 | *.bz2 30 | *.gz 31 | .DS_Store 32 | .Spotlight* 33 | .Trash* 34 | .fseventd 35 | .fseventsd 36 | 37 | # Created by https://www.gitignore.io/api/xcode 38 | 39 | ### Xcode ### 40 | # Xcode 41 | # 42 | # gitignore contributors: remember to update Global/Xcode.gitignore, Objective-C.gitignore & Swift.gitignore 43 | 44 | ## Build generated 45 | build/ 46 | DerivedData/ 47 | 48 | ## Various settings 49 | *.pbxuser 50 | !default.pbxuser 51 | *.mode1v3 52 | !default.mode1v3 53 | *.mode2v3 54 | !default.mode2v3 55 | *.perspectivev3 56 | !default.perspectivev3 57 | xcuserdata/ 58 | 59 | ## Other 60 | *.moved-aside 61 | *.xccheckout 62 | *.xcscmblueprint 63 | 64 | # End of https://www.gitignore.io/api/xcode 65 | -------------------------------------------------------------------------------- /Math/gcd/gcd.c: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #include "gcd.h" 24 | 25 | int gcd(int a, int b) { 26 | int t; 27 | while(b != 0) 28 | { 29 | t = a % b; 30 | a = b; 31 | b = t; 32 | } 33 | return a; 34 | } 35 | -------------------------------------------------------------------------------- /Math/gcd/gcd.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | int gcd(int a, int b); 24 | -------------------------------------------------------------------------------- /Math/gcd/gcd.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Math/gcd/gcd.xcodeproj/project.xcworkspace/xcshareddata/gcd.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | D286F755-8D3A-4AF6-A5F9-0DD159EF6EFE 9 | IDESourceControlProjectName 10 | gcd 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | Math/gcd/gcd.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Math/gcd/gcd.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/gcd.a.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Math/gcd/gcd.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | gcd.a.xcscheme 8 | 9 | orderHint 10 | 47 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1BD714FD11CEC5030089FF36 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Math/gcd/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #include "gcd.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | // insert code here... 29 | NSLog(@"7 == %d!", gcd(35,56)); 30 | [pool drain]; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /Math/gcd/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | t.xcscheme 8 | 9 | orderHint 10 | 0 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DD76F960486AA7600D96B5E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Math/gcd/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Math/lcm/lcm.c: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "gcd.h" 24 | #import "lcm.h" 25 | 26 | int lcm(int a, int b) { 27 | int c; 28 | if (b > a) { 29 | c=b; b=a; a=c; 30 | } 31 | return a*b/gcd(a,b); 32 | } 33 | -------------------------------------------------------------------------------- /Math/lcm/lcm.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | int lcm(int a, int b); 24 | -------------------------------------------------------------------------------- /Math/lcm/lcm.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Math/lcm/lcm.xcodeproj/project.xcworkspace/xcshareddata/lcm.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 53A691A8-7960-46BF-81A6-0CE633F7DE9F 9 | IDESourceControlProjectName 10 | lcm 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | Math/lcm/lcm.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Math/lcm/lcm.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/lcm.a.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Math/lcm/lcm.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | lcm.a.xcscheme 8 | 9 | orderHint 10 | 36 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 1BD7157411CEC69B0089FF36 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Math/lcm/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "lcm.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | // insert code here... 29 | NSLog(@"%d",lcm(35,45)); 30 | [pool drain]; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /Math/lcm/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | t.xcscheme 8 | 9 | orderHint 10 | 11 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DD76F960486AA7600D96B5E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Math/lcm/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+AES/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSData/NSData+AES/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | NICE 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AES.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | #import 25 | 26 | @interface NSData (AES) 27 | 28 | -(NSData*) encrypt:(NSData*) key; 29 | -(NSData*) encryptWithString:(NSString*) key; 30 | -(NSData*) encrypt:(NSData*) key 31 | withPadding:(CCOptions) options; 32 | -(NSData*) encrypt:(NSData*) key 33 | withInitial:(NSData*) iv; 34 | -(NSData*) encrypt:(NSData*) key 35 | withInitial:(NSData*) iv 36 | andPadding:(CCOptions) options; 37 | 38 | -(NSData*) decrypt:(NSData*) key; 39 | -(NSData*) decryptWithString:(NSString*) key; 40 | -(NSData*) decrypt:(NSData*) key 41 | withPadding:(CCOptions) options; 42 | -(NSData*) decrypt:(NSData*) key 43 | withInitial:(NSData*) iv; 44 | -(NSData*) decrypt:(NSData*) key 45 | withInitial:(NSData*) iv 46 | andPadding:(CCOptions) options; 47 | 48 | @end 49 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AES.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AES.xcodeproj/project.xcworkspace/xcshareddata/NSData+AES.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 4CDADEF5-A82F-4D12-96EF-2C0D00D9620A 9 | IDESourceControlProjectName 10 | NSData+AES 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSData/NSData+AES/NSData+AES.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AES.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NSData+AES.xcscheme 8 | 9 | orderHint 10 | 38 11 | 12 | NSDataAES.xcscheme 13 | 14 | orderHint 15 | 41 16 | 17 | SHA256AES.xcscheme 18 | 19 | orderHint 20 | 44 21 | 22 | aes.xcscheme 23 | 24 | orderHint 25 | 40 26 | 27 | 28 | SuppressBuildableAutocreation 29 | 30 | 1BA490CA1299F420004FA697 31 | 32 | primary 33 | 34 | 35 | 1BA4950A129B0547004FA697 36 | 37 | primary 38 | 39 | 40 | 1BCEF914129B1B2C001DD952 41 | 42 | primary 43 | 44 | 45 | 8DC2EF4F0486A6940098B216 46 | 47 | primary 48 | 49 | 50 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AESKey.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "NSData+AES.h" 24 | 25 | @interface NSData (AESKey) 26 | 27 | -(NSData*) encryptValue:(NSData*) value; 28 | -(NSData*) encryptValue:(NSData*) value usingPadding:(CCOptions)options; 29 | -(NSData*) decryptValue:(NSData*) value; 30 | -(NSData*) decryptValue:(NSData*) value usingPadding:(CCOptions)options; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AESKey.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import "NSData+AESKey.h" 23 | 24 | @implementation NSData (AESKey) 25 | 26 | -(NSData*) encryptValue:(NSData*) value { 27 | return [value encrypt:self withPadding:kCCOptionPKCS7Padding]; 28 | } 29 | 30 | -(NSData*) encryptValue:(NSData*) value usingPadding:(CCOptions)options { 31 | return [value encrypt:self withPadding:options]; 32 | } 33 | 34 | -(NSData*) decryptValue:(NSData*) value { 35 | return [value decrypt:self withPadding:kCCOptionPKCS7Padding]; 36 | } 37 | 38 | - (NSData *)decryptValue:(NSData *) value usingPadding:(CCOptions)options 39 | { 40 | return [value decrypt:self withPadding:options]; 41 | } 42 | 43 | @end 44 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AESValue.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "NSData+AES.h" 24 | 25 | @interface NSData (AESValue) 26 | 27 | -(NSData*) encryptWithKey:(NSData*) key; 28 | -(NSData*) encryptWithKey:(NSData*) key usingPadding:(CCOptions)options; 29 | -(NSData*) decryptWithKey:(NSData*) key; 30 | -(NSData*) decryptWithKey:(NSData*) key usingPadding:(CCOptions)options; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AESValue.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import "NSData+AESValue.h" 23 | 24 | @implementation NSData (AESValue) 25 | 26 | -(NSData*) encryptWithKey:(NSData*) key { 27 | return [self encrypt:key withPadding:kCCOptionPKCS7Padding]; 28 | } 29 | 30 | -(NSData*) encryptWithKey:(NSData*) key usingPadding:(CCOptions)options { 31 | return [self encrypt:key withPadding:options]; 32 | } 33 | 34 | -(NSData*) decryptWithKey:(NSData*) key { 35 | return [self decrypt:key withPadding:kCCOptionPKCS7Padding]; 36 | } 37 | 38 | - (NSData *)decryptWithKey:(NSData *)key usingPadding:(CCOptions)options { 39 | return [self decrypt:key withPadding:options]; 40 | } 41 | 42 | @end 43 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSData+AES_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSData+AES' target in the 'NSData+AES' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSMutableData+AES.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "NSData+AES.h" 24 | 25 | @interface NSMutableData (AES) 26 | 27 | -(NSData*) encryptInPlace:(NSData*) key; 28 | -(NSData*) encryptInPlace:(NSData*) key withPadding:(CCOptions)options; 29 | -(NSData*) decryptInPlace:(NSData*) key; 30 | -(NSData*) decryptInPlace:(NSData*) key withPadding:(CCOptions)options; 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /NSData/NSData+AES/NSMutableData+AES.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import "cipher.h" 23 | #import "NSMutableData+AES.h" 24 | 25 | @implementation NSMutableData (AES) 26 | 27 | -(NSData*) encryptInPlace:(NSData*) key { 28 | [self encryptInPlace:key withPadding:kCCOptionPKCS7Padding]; 29 | return key; 30 | } 31 | 32 | -(NSData*) encryptInPlace:(NSData*) key withPadding:(CCOptions)options { 33 | [self setData:cipher(key,self,nil,kCCEncrypt,options,nil)]; 34 | return key; 35 | } 36 | 37 | -(NSData*) decryptInPlace:(NSData*) key { 38 | [self decryptInPlace:key withPadding:kCCOptionPKCS7Padding]; 39 | return key; 40 | } 41 | 42 | - (NSData*) decryptInPlace:(NSData *)key withPadding:(CCOptions)options { 43 | [self setData: cipher(key,self,nil,kCCDecrypt,options,nil)]; 44 | return key; 45 | } 46 | 47 | @end 48 | -------------------------------------------------------------------------------- /NSData/NSData+AES/cipher.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | #import 25 | 26 | NSData *sha1(NSData *bytes); 27 | NSData *sha256(NSData *bytes); 28 | 29 | NSData *cipher(NSData *key, 30 | NSData *value, 31 | NSData *iv, 32 | CCOperation operation, 33 | CCOptions options, 34 | NSMutableData *output); -------------------------------------------------------------------------------- /NSData/NSData+AES/main.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+AES/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+AES/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSData+AES/NSData+AES.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | NSLog(@"testing symmetric encrypt/decrypt ..."); 29 | NSString *_key = @"hello"; 30 | NSString *_secret = @"hello"; 31 | NSData *_secretData = [_secret dataUsingEncoding:NSASCIIStringEncoding]; 32 | 33 | NSLog(@"plaintext string: %@",[[NSString alloc] initWithData:_secretData encoding:NSASCIIStringEncoding]); 34 | 35 | NSData *encryptedData = [_secretData encryptWithString:_key]; 36 | 37 | NSLog(@"encrypted data: %@", encryptedData); 38 | 39 | NSData *data = [encryptedData decryptWithString:_key]; 40 | NSLog(@"decrypted data: %@", data); 41 | NSString *str = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; 42 | NSLog(@"decrypted string: %@", str); 43 | NSLog(@"test finished."); 44 | 45 | [pool drain]; 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /NSData/NSData+AES/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Unit Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 38 | 39 | 40 | 41 | 49 | 50 | 52 | 53 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /NSData/NSData+AES/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Unit Tests.xcscheme 8 | 9 | orderHint 10 | 19 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 6 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1BDB9D8E11D6DE88007D2F8D 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSData/NSData+AES/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/NSData+Adler32.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | 24 | @interface NSData (Adler32) 25 | 26 | -(uint32_t) adler32; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/NSData+Adler32.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import "NSData+Adler32.h" 23 | #import "Adler-32.h" 24 | 25 | @implementation NSData (Adler32) 26 | 27 | -(uint32_t) adler32 { 28 | return adler32_fast([self bytes], [self length]); 29 | } 30 | 31 | @end 32 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/NSData+Adler32.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/NSData+Adler32.xcodeproj/project.xcworkspace/xcshareddata/NSData+Adler32.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 49C68FA6-65DE-4F7B-BAF2-B235A7E8281A 9 | IDESourceControlProjectName 10 | NSData+Adler32 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSData/NSData+Adler32/NSData+Adler32.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/NSData+Adler32_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSData+Adler32' target in the 'NSData+Adler32' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/main.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSData+Adler32/NSData+Adler32.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | /* 28 | NSLog(@"testing symmetric encrypt/decrypt ..."); 29 | NSString *_key = @"hello"; 30 | NSString *_secret = @"hello"; 31 | NSData *_secretData = [_secret dataUsingEncoding:NSASCIIStringEncoding]; 32 | 33 | NSLog(@"plaintext string: %@",[[NSString alloc] initWithData:_secretData encoding:NSASCIIStringEncoding]); 34 | 35 | CCOptions padding = kCCOptionPKCS7Padding; 36 | NSData *encryptedData = [self encrypt:_secretData key:[self md5data:_key] padding:&padding]; 37 | 38 | NSLog(@"encrypted data: %@", encryptedData); 39 | 40 | NSLog(@"encoded string ASCII: %@",[[NSString alloc] initWithData:encryptedData encoding:NSASCIIStringEncoding]); 41 | NSLog(@"encoded string UTF8: %@",[[NSString alloc] initWithData:encryptedData encoding:NSUTF8StringEncoding]); 42 | 43 | NSData *data = [self decrypt:encryptedData key:[self md5data:_key] padding:&padding]; 44 | NSLog(@"decrypted data: %@", data); 45 | NSString *str = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; 46 | NSLog(@"decrypted string: %@", str); 47 | NSLog(@"test finished."); 48 | //*/ 49 | [pool drain]; 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /NSData/NSData+Adler32/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+Output/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSData/NSData+Output/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSData/NSData+Output/NSData+Output.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import 24 | 25 | @interface NSData (Output) 26 | 27 | -(NSString*) descriptionAsHex; 28 | -(const char*) descriptionAsHexUTF8String; 29 | -(NSString*) descriptionAsCharacters:(BOOL)encodeNonPrintable; 30 | -(NSString*) descriptionAsCharacters; 31 | 32 | -(void) writeToFilePointer:(FILE*) fp; 33 | -(void) writeToStandardOut; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /NSData/NSData+Output/NSData+Output.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSData/NSData+Output/NSData+Output.xcodeproj/project.xcworkspace/xcshareddata/NSData+Output.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 66686F2F-EFAC-4CF4-995A-0F740D4D74CD 9 | IDESourceControlProjectName 10 | NSData+Output 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSData/NSData+Output/NSData+Output.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSData/NSData+Output/NSData+Output.xcodeproj/project.xcworkspace/xcuserdata/rnix.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicerobot/objc/5486ee4517ad8e58de437d159f6adfc95984ea15/NSData/NSData+Output/NSData+Output.xcodeproj/project.xcworkspace/xcuserdata/rnix.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /NSData/NSData+Output/NSData+Output.xcodeproj/project.xcworkspace/xcuserdata/rnix.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_BuildLocationStyle 6 | 2 7 | 8 | 9 | -------------------------------------------------------------------------------- /NSData/NSData+Output/NSData+Output.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NSData+Output.xcscheme 8 | 9 | orderHint 10 | 33 11 | 12 | NSDataOutput.xcscheme 13 | 14 | orderHint 15 | 3 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1BA49545129B08D7004FA697 21 | 22 | primary 23 | 24 | 25 | 8DC2EF4F0486A6940098B216 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSData/NSData+Output/NSData+Output_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSData+Output' target in the 'NSData+Output' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+Output/main.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+Output/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+Output/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSData+Output/NSData+Output.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | /* 28 | NSLog(@"testing symmetric encrypt/decrypt ..."); 29 | NSString *_key = @"hello"; 30 | NSString *_secret = @"hello"; 31 | NSData *_secretData = [_secret dataUsingEncoding:NSASCIIStringEncoding]; 32 | 33 | NSLog(@"plaintext string: %@",[[NSString alloc] initWithData:_secretData encoding:NSASCIIStringEncoding]); 34 | 35 | CCOptions padding = kCCOptionPKCS7Padding; 36 | NSData *encryptedData = [self encrypt:_secretData key:[self md5data:_key] padding:&padding]; 37 | 38 | NSLog(@"encrypted data: %@", encryptedData); 39 | 40 | NSLog(@"encoded string ASCII: %@",[[NSString alloc] initWithData:encryptedData encoding:NSASCIIStringEncoding]); 41 | NSLog(@"encoded string UTF8: %@",[[NSString alloc] initWithData:encryptedData encoding:NSUTF8StringEncoding]); 42 | 43 | NSData *data = [self decrypt:encryptedData key:[self md5data:_key] padding:&padding]; 44 | NSLog(@"decrypted data: %@", data); 45 | NSString *str = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; 46 | NSLog(@"decrypted string: %@", str); 47 | NSLog(@"test finished."); 48 | //*/ 49 | [pool drain]; 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /NSData/NSData+Output/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Unit Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 5 | 8 | 9 | 14 | 15 | 17 | 23 | 24 | 25 | 26 | 27 | 38 | 39 | 40 | 41 | 49 | 50 | 52 | 53 | 56 | 57 | 58 | -------------------------------------------------------------------------------- /NSData/NSData+Output/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Unit Tests.xcscheme 8 | 9 | orderHint 10 | 25 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 42 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1BDB9D8E11D6DE88007D2F8D 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSData/NSData+Output/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/NSData+stringAsBase.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | @interface NSData (stringAsBase) 26 | 27 | -(NSString*) stringAsBase:(int) base; 28 | 29 | -(NSString*) stringAsBase2; 30 | -(NSString*) stringAsBase8; 31 | -(NSString*) stringAsBase16; 32 | -(NSString*) stringAsBase32; 33 | -(NSString*) stringAsBase64; 34 | -(NSString*) stringAsBase94; 35 | 36 | -(NSString*) stringAsBase:(int) base withPadding:(BOOL) pad; 37 | 38 | -(NSString*) stringAsBase2withPadding:(BOOL) pad; 39 | -(NSString*) stringAsBase8withPadding:(BOOL) pad; 40 | -(NSString*) stringAsBase16withPadding:(BOOL) pad; 41 | -(NSString*) stringAsBase32withPadding:(BOOL) pad; 42 | -(NSString*) stringAsBase64withPadding:(BOOL) pad; 43 | -(NSString*) stringAsBase94withPadding:(BOOL) pad; 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/NSData+stringAsBase.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/NSData+stringAsBase.xcodeproj/project.xcworkspace/xcshareddata/NSData+stringAsBase.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 397E6AC3-5EE8-48E9-B419-8333B781A711 9 | IDESourceControlProjectName 10 | NSData+stringAsBase 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSData/NSData+stringAsBase/NSData+stringAsBase.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/NSData+stringAsBase.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NSData+stringAsBase.xcscheme 8 | 9 | orderHint 10 | 9 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DC2EF4F0486A6940098B216 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/NSData+stringAsBase_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSData+stringAsBase' target in the 'NSData+stringAsBase' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSData+stringAsBase/NSData+stringAsBase.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | ///* 29 | for (int i=2; i<=94; i++) { 30 | NSLog(@"Base%d : %@", i, [[NSData dataWithBytes:"EFG" length:3] stringAsBase:i]); 31 | } 32 | for (int i=2; i<=94; i++) { 33 | NSLog(@"Base%d : %@", i, [[NSData dataWithBytes:"\x1\x7f\xff" length:3] stringAsBase:i]); 34 | } 35 | NSString *s; 36 | s = @"AnnMarie"; 37 | for (int i=2; i<=94; i++) { 38 | NSLog(@"Base%d : %@ : %@", i, s, [[s dataUsingEncoding:NSUTF8StringEncoding] stringAsBase:i]); 39 | } 40 | s = @"Nice Robot Corporation"; 41 | for (int i=2; i<=94; i++) { 42 | NSLog(@"Base%d : %@ : %@", i, s, [[s dataUsingEncoding:NSUTF8StringEncoding] stringAsBase:i]); 43 | } 44 | //*/ 45 | [pool drain]; 46 | return 0; 47 | } 48 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Unit Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Unit Tests.xcscheme 8 | 9 | orderHint 10 | 39 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 48 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1BDB9D8E11D6DE88007D2F8D 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSData/NSData+stringAsBase/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+AES/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSString/NSString+AES/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSString/NSString+AES/NSString+AES.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | #import 25 | 26 | @interface NSString (AES) 27 | 28 | -(NSData*) encrypt:(NSString*) key; 29 | -(NSData*) encrypt:(NSString*) key 30 | withPadding:(CCOptions) options; 31 | -(NSData*) encrypt:(NSString*) key 32 | withInitial:(NSData*) iv; 33 | -(NSData*) encrypt:(NSString*) key 34 | withInitial:(NSData*) iv 35 | andPadding:(CCOptions) options; 36 | 37 | -(NSData*) decrypt:(NSString*) key; 38 | -(NSData*) decrypt:(NSString*) key 39 | withPadding:(CCOptions) options; 40 | -(NSData*) decrypt:(NSString*) key 41 | withInitial:(NSData*) iv; 42 | -(NSData*) decrypt:(NSString*) key 43 | withInitial:(NSData*) iv 44 | andPadding:(CCOptions) options; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /NSString/NSString+AES/NSString+AES.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSString/NSString+AES/NSString+AES.xcodeproj/project.xcworkspace/xcshareddata/NSString+AES.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 1D2874FF-12FE-4A5F-9123-E2984AB12FDA 9 | IDESourceControlProjectName 10 | NSString+AES 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSString/NSString+AES/NSString+AES.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSString/NSString+AES/NSString+AES.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/NSStringAES.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /NSString/NSString+AES/NSString+AES.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NSString+AES.xcscheme 8 | 9 | orderHint 10 | 43 11 | 12 | NSStringAES.xcscheme 13 | 14 | orderHint 15 | 18 16 | 17 | aes.xcscheme 18 | 19 | orderHint 20 | 10 21 | 22 | 23 | SuppressBuildableAutocreation 24 | 25 | 1BA49311129A3137004FA697 26 | 27 | primary 28 | 29 | 30 | 1BA49570129B097F004FA697 31 | 32 | primary 33 | 34 | 35 | 8DC2EF4F0486A6940098B216 36 | 37 | primary 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /NSString/NSString+AES/NSString+AES_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSString+AES' target in the 'NSString+AES' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+AES/main.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | -------------------------------------------------------------------------------- /NSString/NSString+AES/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSString/NSString+AES/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSString+AES/NSString+AES.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | NSString *s = @"anna"; 29 | for (int i=2; i<=94; i++) { 30 | NSLog(@"Base%d : %@ : %@", i, s, [s stringAsBase:i]); 31 | } 32 | s = @"Robert Clifton Nix"; 33 | for (int i=2; i<=94; i++) { 34 | NSLog(@"Base%d : %@ : %@", i, s, [s stringAsBase:i]); 35 | } 36 | 37 | [pool drain]; 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /NSString/NSString+AES/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Unit Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /NSString/NSString+AES/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Unit Tests.xcscheme 8 | 9 | orderHint 10 | 5 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 17 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1B9EF4E211D7C93F00298000 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSString/NSString+AES/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/NSString+Adler32.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | 24 | @interface NSString (Adler32) 25 | 26 | -(uint32_t) adler32; 27 | 28 | @end 29 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/NSString+Adler32.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import "NSString+Adler32.h" 23 | #import "Adler-32.h" 24 | 25 | @implementation NSString (Adler32) 26 | 27 | -(uint32_t) adler32 { 28 | NSUInteger len = [self lengthOfBytesUsingEncoding:NSUTF8StringEncoding]; 29 | return adler32_fast([self UTF8String], len); 30 | } 31 | 32 | @end 33 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/NSString+Adler32.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/NSString+Adler32.xcodeproj/project.xcworkspace/xcshareddata/NSString+Adler32.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | C4A02457-BDAD-4532-9144-03A9522E8967 9 | IDESourceControlProjectName 10 | NSString+Adler32 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSString/NSString+Adler32/NSString+Adler32.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/NSString+Adler32_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSString+Adler32' target in the 'NSString+Adler32' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/main.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSString+Adler32/NSString+Adler32.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | /* 28 | NSLog(@"testing symmetric encrypt/decrypt ..."); 29 | NSString *_key = @"hello"; 30 | NSString *_secret = @"hello"; 31 | NSData *_secretData = [_secret dataUsingEncoding:NSASCIIStringEncoding]; 32 | 33 | NSLog(@"plaintext string: %@",[[NSString alloc] initWithData:_secretData encoding:NSASCIIStringEncoding]); 34 | 35 | CCOptions padding = kCCOptionPKCS7Padding; 36 | NSData *encryptedData = [self encrypt:_secretData key:[self md5data:_key] padding:&padding]; 37 | 38 | NSLog(@"encrypted data: %@", encryptedData); 39 | 40 | NSLog(@"encoded string ASCII: %@",[[NSString alloc] initWithData:encryptedData encoding:NSASCIIStringEncoding]); 41 | NSLog(@"encoded string UTF8: %@",[[NSString alloc] initWithData:encryptedData encoding:NSUTF8StringEncoding]); 42 | 43 | NSData *data = [self decrypt:encryptedData key:[self md5data:_key] padding:&padding]; 44 | NSLog(@"decrypted data: %@", data); 45 | NSString *str = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; 46 | NSLog(@"decrypted string: %@", str); 47 | NSLog(@"test finished."); 48 | //*/ 49 | [pool drain]; 50 | return 0; 51 | } 52 | -------------------------------------------------------------------------------- /NSString/NSString+Adler32/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/NSString+stringAsBase.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | @interface NSString (stringAsBase) 26 | 27 | -(NSString*) stringAsBase:(int) base; 28 | 29 | -(NSString*) stringAsBase2; 30 | -(NSString*) stringAsBase8; 31 | -(NSString*) stringAsBase16; 32 | -(NSString*) stringAsBase32; 33 | -(NSString*) stringAsBase64; 34 | -(NSString*) stringAsBase94; 35 | 36 | -(NSString*) toBetterBase64; 37 | 38 | -(NSString*) stringAsBase:(int) base withPadding:(BOOL) pad; 39 | -(NSString*) stringAsBase2withPadding:(BOOL) pad; 40 | -(NSString*) stringAsBase8withPadding:(BOOL) pad; 41 | -(NSString*) stringAsBase16withPadding:(BOOL) pad; 42 | -(NSString*) stringAsBase32withPadding:(BOOL) pad; 43 | -(NSString*) stringAsBase64withPadding:(BOOL) pad; 44 | -(NSString*) stringAsBase94withPadding:(BOOL) pad; 45 | 46 | @end 47 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/NSString+stringAsBase.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/NSString+stringAsBase.xcodeproj/project.xcworkspace/xcshareddata/NSString+stringAsBase.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 92FE3E52-A81B-449C-B3C5-9E5BF2848610 9 | IDESourceControlProjectName 10 | NSString+stringAsBase 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSString/NSString+stringAsBase/NSString+stringAsBase.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/NSString+stringAsBase.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NSString+stringAsBase.xcscheme 8 | 9 | orderHint 10 | 22 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DC2EF4F0486A6940098B216 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/NSString+stringAsBase_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSString+stringAsBase' target in the 'NSString+stringAsBase' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSString+stringAsBase/NSString+stringAsBase.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | NSString *s = @"anna"; 29 | for (int i=2; i<=94; i++) { 30 | NSLog(@"Base%d : %@ : %@", i, s, [s stringAsBase:i]); 31 | } 32 | s = @"Robert Clifton Nix"; 33 | for (int i=2; i<=94; i++) { 34 | NSLog(@"Base%d : %@ : %@", i, s, [s stringAsBase:i]); 35 | } 36 | 37 | [pool drain]; 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Unit Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Unit Tests.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 12 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1B9EF4E211D7C93F00298000 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsBase/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/NSString+stringAsReverseString.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | @interface NSString (stringAsReverseString) 26 | 27 | + (NSString*) stringAsReverseString:(NSString*)str; 28 | - (NSString*) stringAsReverseString; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/NSString+stringAsReverseString.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "NSString+stringAsReverseString.h" 24 | 25 | @implementation NSString (stringAsReverseString) 26 | 27 | + (NSString*) stringAsReverseString:(NSString*)str { 28 | return [str stringAsReverseString]; 29 | } 30 | 31 | - (NSString*) stringAsReverseString { 32 | int x = [self length]; 33 | NSMutableString *result = [NSMutableString stringWithCapacity:x]; 34 | while (x) { 35 | [result appendFormat:@"%c",[self characterAtIndex:--x]]; 36 | } 37 | return result; 38 | } 39 | 40 | @end 41 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/NSString+stringAsReverseString.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/NSString+stringAsReverseString.xcodeproj/project.xcworkspace/xcshareddata/NSString+stringAsReverseString.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 40C8DBDF-0DE7-4CE8-B6D1-A4926C5EE6C3 9 | IDESourceControlProjectName 10 | NSString+stringAsReverseString 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSString/NSString+stringAsReverseString/NSString+stringAsReverseString.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/NSString+stringAsReverseString.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | NSString+stringAsReverseString.xcscheme 8 | 9 | orderHint 10 | 21 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DC2EF4F0486A6940098B216 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/NSString+stringAsReverseString_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSString+stringAsReverseString' target in the 'NSString+stringAsReverseString' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSString+stringAsReverseString/NSString+stringAsReverseString.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | // insert code here... 29 | NSLog(@"%@", [@"Hello, World!" stringAsReverseString]); 30 | [pool drain]; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Unit Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Unit Tests.xcscheme 8 | 9 | orderHint 10 | 27 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 14 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1BDB9DE311D6DFF5007D2F8D 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /NSString/NSString+stringAsReverseString/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/NSURL+Bug8840060Fix.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | @interface NSURL (Bug8840060Fix) 26 | 27 | -(NSURL*) initWithRFCString:(NSString*)url; 28 | +(NSURL*) URLWithRFCString:(NSString*)url; 29 | 30 | @end 31 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/NSURL+Bug8840060Fix.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "NSURL+Bug8840060Fix.h" 24 | 25 | NSString* stripFragments(NSString* url) { 26 | NSArray *fragments = [url componentsSeparatedByString:@"#"]; 27 | if (2 <= [fragments count]) { 28 | url = [NSString stringWithFormat:@"%@#%@", 29 | [fragments objectAtIndex:0], 30 | [fragments objectAtIndex:1]]; 31 | } 32 | return url; 33 | } 34 | 35 | @implementation NSURL (Bug8840060Fix) 36 | 37 | -(NSURL*) initWithRFCString:(NSString*)url { 38 | return [self initWithString:stripFragments(url)]; 39 | } 40 | 41 | +(NSURL*) URLWithRFCString:(NSString*)url { 42 | return [NSURL URLWithString:stripFragments(url)]; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/NSURL+Bug8840060Fix.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/NSURL+Bug8840060Fix.xcodeproj/project.xcworkspace/xcshareddata/NSURL+Bug8840060Fix.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | B5CF316A-5ED5-4DD8-9ABC-88EFFB2B8B70 9 | IDESourceControlProjectName 10 | NSURL+Bug8840060Fix 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | NSURL/NSURL+Bug8840060Fix/NSURL+Bug8840060Fix.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/NSURL+Bug8840060Fix_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'NSURL+Bug8840060Fix' target in the 'NSURL+Bug8840060Fix' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /NSURL/NSURL+Bug8840060Fix/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Utilities 2 | 3 | ## Libraries 4 | 5 | - **gcd** - Greatest Common Denominator 6 | - **lcm** - Least Common Multiple 7 | - **swap** - Swap values 8 | 9 | ## Frameworks 10 | 11 | - **BaseCharacters** 12 | 13 | Single to encapsulate characters used by different bases. 14 | 15 | - **NSData+stringAsBase** 16 | 17 | Convert the NSData object into an NSString of the specified base. 18 | 19 | - **NSString+stringAsBase** 20 | 21 | Convert the NSString into an NSString of the specified base. 22 | 23 | - **NSString+stringAsReverseString** 24 | 25 | Returns a reversed NSString. 26 | -------------------------------------------------------------------------------- /Util/Adler-32/Adler-32.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #include 24 | 25 | uint32_t adler32_update(uint32_t ck, const char data); 26 | uint32_t adler32(const char *data, int data_len); 27 | uint32_t adler32_fast(const char *data, int data_len); 28 | uint32_t adler32_file(FILE *fp); 29 | uint32_t adler32_file_update(uint32_t ck, FILE *fp); 30 | uint32_t adler32_filename(const char *fn); 31 | uint32_t adler32_filename_update(uint32_t ck, const char *fn); 32 | -------------------------------------------------------------------------------- /Util/Adler-32/Adler-32.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Util/Adler-32/Adler-32.xcodeproj/project.xcworkspace/xcshareddata/Adler-32.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 71B4725D-1302-4C28-920E-609C82C9C0B8 9 | IDESourceControlProjectName 10 | Adler-32 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | Util/Adler-32/Adler-32.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Util/Adler-32/Adler-32.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Adler-32.a.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Util/Adler-32/Adler-32.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Adler-32.a.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | adler.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1B929B961288F7D800C3795B 21 | 22 | primary 23 | 24 | 25 | D2AAC07D0554694100DB518D 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Util/Adler-32/Adler-32_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'Adler-32' target in the 'Adler-32' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/Adler-32/main.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | #import "Adler-32.h" 25 | -------------------------------------------------------------------------------- /Util/Adler-32/main.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "main.h" 24 | 25 | int main(int argc, char *argv[]) 26 | { 27 | BOOL tty_used = 0; // TODO How to continue reading from stdin? 28 | 29 | for (int i=0; i. 19 | */ 20 | 21 | 22 | #import 23 | 24 | int main (int argc, const char * argv[]) { 25 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 26 | 27 | // insert code here... 28 | NSLog(@"Hello, World!"); 29 | [pool drain]; 30 | return 0; 31 | } 32 | -------------------------------------------------------------------------------- /Util/Adler-32/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | t.xcscheme 8 | 9 | orderHint 10 | 1 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DD76F960486AA7600D96B5E 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Util/Adler-32/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/BaseCharacters/BaseCharacters.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | #define BASES 94 26 | 27 | @interface BaseCharacters : NSObject { 28 | 29 | } 30 | 31 | + (NSString*) get:(int) base; 32 | 33 | @end 34 | -------------------------------------------------------------------------------- /Util/BaseCharacters/BaseCharacters.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Util/BaseCharacters/BaseCharacters.xcodeproj/project.xcworkspace/xcshareddata/BaseCharacters.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 346CD95A-0B70-4609-ADD0-8DA99032692B 9 | IDESourceControlProjectName 10 | BaseCharacters 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | Util/BaseCharacters/BaseCharacters.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Util/BaseCharacters/BaseCharacters.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | BaseCharacters.xcscheme 8 | 9 | orderHint 10 | 28 11 | 12 | 13 | SuppressBuildableAutocreation 14 | 15 | 8DC2EF4F0486A6940098B216 16 | 17 | primary 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /Util/BaseCharacters/BaseCharacters_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'BaseCharacters' target in the 'BaseCharacters' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/BaseCharacters/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Util/BaseCharacters/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Util/BaseCharacters/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Util/BaseCharacters/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "BaseCharacters/BaseCharacters.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | 28 | for (int i=2; i<=BASES; i++) { 29 | NSLog(@"%d %@",i, [BaseCharacters get:i]); 30 | } 31 | 32 | [pool drain]; 33 | return 0; 34 | } 35 | -------------------------------------------------------------------------------- /Util/BaseCharacters/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/Unit Tests.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 13 | 14 | 16 | 22 | 23 | 24 | 25 | 26 | 34 | 35 | 36 | 37 | 44 | 45 | 47 | 48 | 51 | 52 | 53 | -------------------------------------------------------------------------------- /Util/BaseCharacters/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | Unit Tests.xcscheme 8 | 9 | orderHint 10 | 35 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 29 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1BDB9F2011D78D6D007D2F8D 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Util/BaseCharacters/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/CommandLine/Argument.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | 26 | @interface Argument : NSObject { 27 | 28 | } 29 | 30 | @property (readonly) int position; 31 | 32 | -(id)initWithPosition:(int)position_; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Util/CommandLine/Argument.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "Argument.h" 24 | 25 | @implementation Argument 26 | 27 | @synthesize position; 28 | 29 | -(id)initWithPosition:(int)position_ { 30 | if (!(self = [super init])) { 31 | return nil; 32 | } 33 | position = position_; 34 | return self; 35 | } 36 | 37 | -(NSString*) description { 38 | return @""; 39 | } 40 | 41 | @end 42 | -------------------------------------------------------------------------------- /Util/CommandLine/CommandLine.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | @interface CommandLine : NSObject { 26 | 27 | } 28 | @property (readonly) NSString* program; 29 | @property (readonly) NSArray* options; 30 | @property (readonly) NSArray* parameters; 31 | 32 | -(id)initUsingOptions:(Class)cl; 33 | -(id)initUsingOptionsName:(NSString*)name; 34 | -(void) parse:(int)argc withArguments:(const char*[])argv; 35 | 36 | +(CommandLine*) commandLineUsingOptions:(Class)optionsClass_; 37 | +(CommandLine*) commandLineUsingOptionsName:(NSString*)name; 38 | +(CommandLine*) commandLine:(int)argc 39 | withArguments:(const char*[])argv 40 | usingOptions:(Class)cl; 41 | +(CommandLine*) commandLine:(int)argc 42 | withArguments:(const char*[])argv 43 | usingOptionsName:(NSString*)name; 44 | +(CommandLine*) commandLine:(int)argc 45 | withArguments:(const char*[])argv; 46 | +(CommandLine*) commandLine:(int)argc,...; 47 | 48 | -(NSString*) description; 49 | -(NSString*) usage; 50 | 51 | @end 52 | -------------------------------------------------------------------------------- /Util/CommandLine/CommandLine.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Util/CommandLine/CommandLine.xcodeproj/project.xcworkspace/xcshareddata/CommandLine.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 1303EA7D-B990-46F7-9B99-07A7F127B3B9 9 | IDESourceControlProjectName 10 | CommandLine 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | Util/CommandLine/CommandLine.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Util/CommandLine/CommandLine_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'CommandLine' target in the 'CommandLine' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/CommandLine/English.lproj/InfoPlist.strings: -------------------------------------------------------------------------------- 1 | /* Localized versions of Info.plist keys */ 2 | 3 | -------------------------------------------------------------------------------- /Util/CommandLine/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | com.yourcompany.${PRODUCT_NAME:rfc1034Identifier} 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | ${PRODUCT_NAME} 17 | CFBundlePackageType 18 | FMWK 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | NSPrincipalClass 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /Util/CommandLine/NSArray+charactersFromString.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | @interface NSArray(charactersFromNSString) 26 | +(id)arrayWithCharactersOfString:(NSString*)str; 27 | @end 28 | -------------------------------------------------------------------------------- /Util/CommandLine/NSArray+charactersFromString.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "NSArray+charactersFromString.h" 24 | 25 | @implementation NSArray(charactersFromNSString) 26 | 27 | +(id)arrayWithCharactersOfString:(NSString*)str { 28 | int l = str?[str length]:0; 29 | NSMutableArray *array = [NSMutableArray arrayWithCapacity:l]; 30 | for (int i=0; i. 19 | */ 20 | 21 | 22 | 23 | #import 24 | #import "CommandLine/Argument.h" 25 | 26 | @interface Option : Argument { 27 | 28 | } 29 | @property (readonly) char type; 30 | @property (readonly,copy) NSString *name; 31 | @property (readonly,copy) id value; 32 | 33 | -(id) init:(int)i type:(char)t withName:(NSString*)n withValue:(NSString*)v; 34 | +(Option*) option:(int)i type:(char)t withName:(NSString*)n withValue:(NSString*)v; 35 | 36 | @end 37 | -------------------------------------------------------------------------------- /Util/CommandLine/Option.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "Option.h" 24 | 25 | @implementation Option 26 | 27 | @synthesize type, name, value; 28 | 29 | -(id) init:(int)i type:(char)t withName:(NSString*)n withValue:(NSString*)v { 30 | if (!(self = [super initWithPosition:i ])) { 31 | return nil; 32 | } 33 | type = t; 34 | name = n; 35 | value = v; 36 | return self; 37 | } 38 | 39 | +(Option*) option:(int)i type:(char)t withName:(NSString*)n withValue:(NSString*)v { 40 | return [[[Option alloc] init:i type:t withName:n withValue:v] autorelease]; 41 | } 42 | 43 | -(NSString*)description { 44 | int nl = [name length]; 45 | NSMutableString* r = [NSMutableString stringWithCapacity:nl+2]; 46 | [r appendString:@"-"]; 47 | if (1 < nl) { 48 | [r appendFormat:@"-"]; 49 | } 50 | [r appendFormat:@"%@",name]; 51 | if (value && 'c' != type) { 52 | [r appendFormat:@"=%@",value]; 53 | } 54 | return r; 55 | } 56 | @end 57 | -------------------------------------------------------------------------------- /Util/CommandLine/Parameter.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | #import "CommandLine/Argument.h" 25 | 26 | @interface Parameter : Argument { 27 | 28 | } 29 | @property (readonly,copy) NSString* value; 30 | 31 | -(id) init:(int)i withValue:(NSString*)v; 32 | +(Parameter*) parameter:(int)i withValue:(NSString*)v; 33 | 34 | @end 35 | -------------------------------------------------------------------------------- /Util/CommandLine/Parameter.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "Parameter.h" 24 | 25 | @implementation Parameter 26 | 27 | @synthesize value; 28 | 29 | -(id) init:(int)i withValue:(NSString*)v { 30 | if (!(self = [super initWithPosition:i ])) { 31 | return nil; 32 | } 33 | value = v; 34 | return self; 35 | } 36 | 37 | +(Parameter*) parameter:(int)i withValue:(NSString*)v { 38 | return [[[Parameter alloc] init:i withValue:v] autorelease]; 39 | } 40 | 41 | -(NSString*) description { 42 | return value; 43 | } 44 | 45 | @end 46 | -------------------------------------------------------------------------------- /Util/CommandLine/t/TestOptions.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "TestOptions.h" 24 | 25 | @implementation TestOptions 26 | 27 | @synthesize help,moreHelp,version,verbose,positional$,astring,anint,multiple; 28 | @synthesize alwaysFive; 29 | @synthesize f,h,H,m,p$,v,V; 30 | 31 | -(void) setValue:(id)value forUndefinedKey:(id)key { 32 | printf("setUndfinedKey: "); 33 | if (key) printf("%s",[key UTF8String]); 34 | if (value) printf(" %s",[[value description] UTF8String]); 35 | printf("\n"); 36 | } 37 | 38 | -(void)setAlwaysFive:(int)f_ { 39 | f = alwaysFive = 5; 40 | printf("setAlwaysFive: %d\n",f_); 41 | } 42 | -(int)getAlwaysFive { 43 | f = alwaysFive = 5; 44 | printf("getAlwaysFive: %d %d\n",alwaysFive,f); 45 | return 5; 46 | } 47 | 48 | -(void)setF:(int)f_ { 49 | f = self.alwaysFive; 50 | } 51 | -(int)getF { 52 | return self.alwaysFive; 53 | } 54 | @end 55 | -------------------------------------------------------------------------------- /Util/CommandLine/t/Unit Tests-Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | English 7 | CFBundleExecutable 8 | ${EXECUTABLE_NAME} 9 | CFBundleIdentifier 10 | com.yourcompany.${PRODUCT_NAME:rfc1034identifier} 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundlePackageType 14 | BNDL 15 | CFBundleShortVersionString 16 | 1.0 17 | CFBundleSignature 18 | ???? 19 | CFBundleVersion 20 | 1 21 | 22 | 23 | -------------------------------------------------------------------------------- /Util/CommandLine/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "CommandLine/CommandLine.h" 24 | #import "TestOptions.h" 25 | 26 | @interface Test : NSObject 27 | @property BOOL b; 28 | @end 29 | @implementation Test 30 | @synthesize b; 31 | @end 32 | 33 | 34 | int main (int argc, const char * argv[]) { 35 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 36 | 37 | CommandLine *cl = [CommandLine commandLineUsingOptionsName:@"TestOptions"]; 38 | //[cl parse:argc withArguments:argv]; 39 | printf("%s\n",[[cl usage] UTF8String]); 40 | 41 | if (0) { 42 | TestOptions *t = [[[TestOptions alloc] init] autorelease]; 43 | printf("1.%d\n",[[t valueForKey:@"f"] intValue]); 44 | t.H = 1; 45 | t.h = 2; 46 | t.v = 3; 47 | t.V = 4; 48 | t.p$ = 5; 49 | t.f = 6; 50 | printf("2.%d %d %d %d %d %d %d\n",t.H,t.h,t.v,t.V,t.p$,t.alwaysFive,t.f); 51 | printf("3.%d\n",[[t valueForKey:@"alwaysFive"] intValue]); 52 | } 53 | 54 | if (0) { 55 | Test *t = [[[Test alloc] init] autorelease]; 56 | [t setValue:[NSNumber numberWithInt:1] forKey:@"b"]; 57 | printf("%d\n",[[t valueForKey:@"b"] intValue]); 58 | } 59 | 60 | [pool drain]; 61 | return 0; 62 | } 63 | -------------------------------------------------------------------------------- /Util/CommandLine/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/jrand/JRandom.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import 24 | 25 | @interface JRandom : NSObject { 26 | @private 27 | unsigned long long randomSeed; 28 | } 29 | -(id)init; 30 | -(id)initWithSeed:(unsigned long long)seed; 31 | -(int)next:(int)bits; 32 | -(int)nextInt; 33 | -(void)setSeed:(unsigned long long)seed; 34 | 35 | @end 36 | -------------------------------------------------------------------------------- /Util/jrand/JRandom.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #import "JRandom.h" 24 | #import "jrand.h" 25 | 26 | @implementation JRandom 27 | 28 | - (id)init 29 | { 30 | return [self initWithSeed:0]; 31 | } 32 | 33 | - (id)initWithSeed:(unsigned long long) seed 34 | { 35 | self = [super init]; 36 | if (self) { 37 | [self setSeed:seed]; 38 | } 39 | 40 | return self; 41 | } 42 | 43 | 44 | 45 | 46 | -(void) setSeed:(unsigned long long) seed 47 | { 48 | @synchronized(self) 49 | { 50 | randomSeed = (seed ^ multiplier) & mask; 51 | } 52 | } 53 | 54 | -(int) nextInt 55 | { 56 | return [self next:32]; 57 | } 58 | 59 | -(int) next:(int)bits 60 | { 61 | @synchronized(self) 62 | { 63 | return sjrandp(&randomSeed,bits); 64 | } 65 | } 66 | 67 | - (void)dealloc 68 | { 69 | [super dealloc]; 70 | } 71 | 72 | @end 73 | -------------------------------------------------------------------------------- /Util/jrand/jRandom/jRandom-Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 'jRandom' target in the 'jRandom' project 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/jrand/jrand.c: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #include 24 | #include 25 | 26 | #include "jrand.h" 27 | 28 | static unsigned long long randomSeed = 0; 29 | 30 | int jrand() { 31 | return jrandn(32); 32 | } 33 | 34 | int jrandn(unsigned long long bits) { 35 | return sjrandp(&randomSeed,bits); 36 | } 37 | 38 | int sjrandn(unsigned long long seed, unsigned long long bits) { 39 | return sjrandnp(&randomSeed,seed,bits); 40 | } 41 | 42 | int sjrandp(unsigned long long *seeder, unsigned long long bits) { 43 | if (!seeder) seeder = &randomSeed; 44 | return sjrandnp(seeder,*seeder,bits); 45 | } 46 | 47 | int sjrandnp(unsigned long long *seeder, unsigned long long seed, unsigned long long bits) { 48 | if (!seeder) seeder = &randomSeed; 49 | return (unsigned int)((*seeder = (seed * multiplier + addend) & mask) >> (48 - bits)); 50 | } 51 | 52 | 53 | void sjrand(unsigned long long seed) 54 | { 55 | spjrand(&randomSeed,seed); 56 | } 57 | 58 | void spjrand(unsigned long long *seeder, unsigned long long seed) 59 | { 60 | if (!seeder) seeder = &randomSeed; 61 | *seeder = (seed ^ multiplier) & mask; 62 | } 63 | -------------------------------------------------------------------------------- /Util/jrand/jrand.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #define multiplier 0x5DEECE66DL 24 | #define addend 0xBL 25 | #define mask ((1L << 48) - 1) 26 | 27 | int jrand(); 28 | 29 | int jrandn(unsigned long long seed); 30 | 31 | int sjrandn(unsigned long long seed, unsigned long long bits); 32 | 33 | int sjrandp(unsigned long long *seeder, unsigned long long bits); 34 | 35 | int sjrandnp(unsigned long long *seeder, unsigned long long seed, unsigned long long bits); 36 | 37 | void sjrand(unsigned long long seed); 38 | 39 | void spjrand(unsigned long long *seeder, unsigned long long seed); 40 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcodeproj/project.xcworkspace/xcshareddata/jrand.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 2DFA92E6-C07B-45D8-8F6C-90E0A93A83F1 9 | IDESourceControlProjectName 10 | jrand 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | Util/jrand/jrand.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcodeproj/project.xcworkspace/xcuserdata/rnix.xcuserdatad/UserInterfaceState.xcuserstate: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nicerobot/objc/5486ee4517ad8e58de437d159f6adfc95984ea15/Util/jrand/jrand.xcodeproj/project.xcworkspace/xcuserdata/rnix.xcuserdatad/UserInterfaceState.xcuserstate -------------------------------------------------------------------------------- /Util/jrand/jrand.xcodeproj/project.xcworkspace/xcuserdata/rnix.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_BuildLocationStyle 6 | 2 7 | 8 | 9 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/jRandom.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/jrand.a.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | jRandom.xcscheme 8 | 9 | orderHint 10 | 3 11 | 12 | jrand.a.xcscheme 13 | 14 | orderHint 15 | 0 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1BABF2D513A84153000A833F 21 | 22 | primary 23 | 24 | 25 | 1BD715D911CECAF90089FF36 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Util/jrand/jrand.xcworkspace/xcuserdata/rnix.xcuserdatad/WorkspaceSettings.xcsettings: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDEWorkspaceUserSettings_BuildLocationStyle 6 | 2 7 | 8 | 9 | -------------------------------------------------------------------------------- /Util/jrand/t/t.java: -------------------------------------------------------------------------------- 1 | /* 2 | * C/Objective-C Utilities - A small, miscellaneous set of C/Objective-C utilities 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of C/Objective-C Utilities. 6 | * 7 | * C/Objective-C Utilities is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * C/Objective-C Utilities is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with C/Objective-C Utilities. If not, see . 19 | */ 20 | 21 | import java.util.Random; 22 | 23 | class t { 24 | public static void main(String... args) { 25 | int seed = 0; 26 | if (args.length > 0) { 27 | seed = Integer.parseInt(args[0]); 28 | } 29 | Random r = new Random(seed); 30 | for (int i=0; i<10; i++) { 31 | System.out.printf("%08X\n",r.nextInt()); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Util/jrand/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "JRandom.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | int seed = 0; 28 | switch (argc) { 29 | case 1: 30 | seed = 0; 31 | break; 32 | default: 33 | seed = atoi(argv[1]); 34 | break; 35 | } 36 | JRandom *r = [[JRandom alloc] initWithSeed:seed]; 37 | for (int i=0; i<10; i++) { 38 | printf("%08X\n",[r nextInt]); 39 | } 40 | [pool drain]; 41 | return 0; 42 | } 43 | -------------------------------------------------------------------------------- /Util/jrand/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcdebugger/Breakpoints.xcbkptlist: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | -------------------------------------------------------------------------------- /Util/jrand/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/t.class.xcscheme: -------------------------------------------------------------------------------- 1 | 2 | 4 | 7 | 8 | 14 | 20 | 21 | 22 | 23 | 24 | 29 | 30 | 31 | 32 | 40 | 41 | 42 | 43 | 50 | 51 | 53 | 54 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /Util/jrand/t/t.xcodeproj/xcuserdata/rnix.xcuserdatad/xcschemes/xcschememanagement.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | SchemeUserState 6 | 7 | t.class.xcscheme 8 | 9 | orderHint 10 | 2 11 | 12 | t.xcscheme 13 | 14 | orderHint 15 | 1 16 | 17 | 18 | SuppressBuildableAutocreation 19 | 20 | 1B02EF0013A8355C0067ADD5 21 | 22 | primary 23 | 24 | 25 | 8DD76F960486AA7600D96B5E 26 | 27 | primary 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /Util/jrand/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /Util/swap/swap.c: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | #include "swap.h" 24 | 25 | void swap(char *a, char *b) { 26 | char tmp = *a; 27 | *a = *b; 28 | *b = tmp; 29 | } 30 | -------------------------------------------------------------------------------- /Util/swap/swap.h: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | 23 | void swap(char *a, char *b); 24 | -------------------------------------------------------------------------------- /Util/swap/swap.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /Util/swap/swap.xcodeproj/project.xcworkspace/xcshareddata/swap.xccheckout: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | IDESourceControlProjectFavoriteDictionaryKey 6 | 7 | IDESourceControlProjectIdentifier 8 | 0EC63A39-E6E3-4E6C-A163-0409D3699196 9 | IDESourceControlProjectName 10 | swap 11 | IDESourceControlProjectOriginsDictionary 12 | 13 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 14 | ssh://github.com/nicerobot/objc.git 15 | 16 | IDESourceControlProjectPath 17 | Util/swap/swap.xcodeproj/project.xcworkspace 18 | IDESourceControlProjectRelativeInstallPathDictionary 19 | 20 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 21 | ../../../.. 22 | 23 | IDESourceControlProjectURL 24 | ssh://github.com/nicerobot/objc.git 25 | IDESourceControlProjectVersion 26 | 110 27 | IDESourceControlProjectWCCIdentifier 28 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 29 | IDESourceControlProjectWCConfigurations 30 | 31 | 32 | IDESourceControlRepositoryExtensionIdentifierKey 33 | public.vcs.git 34 | IDESourceControlWCCIdentifierKey 35 | E22D100F-F899-4AF8-8FCB-C12A6EC25C9F 36 | IDESourceControlWCCName 37 | objc 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /Util/swap/t/t.m: -------------------------------------------------------------------------------- 1 | /* * Objective-C Augments - A small, miscellaneous set of Objective-C String and Data 2 | * augmentations 3 | * Copyright (C) 2011- nicerobot 4 | * 5 | * This file is part of Objective-C Augments. 6 | * 7 | * Objective-C Augments is free software: you can redistribute it and/or modify 8 | * it under the terms of the GNU General Public License as published by 9 | * the Free Software Foundation, either version 3 of the License, or 10 | * (at your option) any later version. 11 | * 12 | * Objective-C Augments is distributed in the hope that it will be useful, 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | * GNU General Public License for more details. 16 | * 17 | * You should have received a copy of the GNU General Public License 18 | * along with Objective-C Augments. If not, see . 19 | */ 20 | 21 | 22 | #import 23 | #import "swap.h" 24 | 25 | int main (int argc, const char * argv[]) { 26 | NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; 27 | char x[] = "abc"; 28 | swap(&x[0],&x[2]); 29 | NSLog(@"%s!",x); 30 | [pool drain]; 31 | return 0; 32 | } 33 | -------------------------------------------------------------------------------- /Util/swap/t/t_Prefix.pch: -------------------------------------------------------------------------------- 1 | // 2 | // Prefix header for all source files of the 't' target in the 't' project. 3 | // 4 | 5 | #ifdef __OBJC__ 6 | #import 7 | #endif 8 | -------------------------------------------------------------------------------- /obj.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 9 | 10 | 12 | 13 | 15 | 16 | 18 | 19 | 21 | 22 | 24 | 25 | 27 | 28 | 30 | 31 | 33 | 34 | 36 | 37 | 39 | 40 | 42 | 43 | 45 | 46 | 48 | 49 | 50 | --------------------------------------------------------------------------------