Upgrading ITFoundation to Xcode 3.0 and the Mac OS X 10.5 SDK.
[ITFoundation.git] / ITCategory-NSString.m
index e08e046..6aed778 100644 (file)
@@ -1,4 +1,5 @@
 #import "ITCategory-NSString.h"
+#import "ITCategory-NSData.h"
 
 @implementation NSString (ITFoundationCategory)
 
@@ -7,7 +8,7 @@
 }
 
 - (id)initWithFourCharCode:(unsigned long)fourCharCode {
-       return UTCreateStringForOSType(fourCharCode);
+       return [self initWithString:(NSString *)UTCreateStringForOSType(fourCharCode)];
        //return [self initWithFormat:@"%.4s", &fourCharCode];
 }
 
        return tmp |= *c_s++;*/
 }
 
+- (NSData *)MD5 {
+       return [[self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO] MD5];
+}
+
+- (NSData *)SHA1 {
+       return [[self dataUsingEncoding:NSUTF8StringEncoding allowLossyConversion:NO] SHA1];
+}
+
 @end
\ No newline at end of file