Skip to content
Browse files

fixed problem with encrypt

  • Loading branch information...
1 parent 0bd9953 commit 1699be4d105da107cad80a93f73912cd850288e4 @jhaynie jhaynie committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 iphone/Classes/NSData+Additions.m
  2. BIN support/osx/encryptor
View
8 iphone/Classes/NSData+Additions.m
@@ -18,8 +18,8 @@
int decodedLength = Base64decode_len(str);
char* decoded = (char*)malloc(sizeof(char) * decodedLength);
Base64decode(decoded,str);
- NSData *result = [NSData dataWithBytesNoCopy:decoded length:decodedLength freeWhenDone:YES];
- return result;
+ NSString *result = [NSString stringWithUTF8String:decoded];
+ return [result dataUsingEncoding:NSUTF8StringEncoding];
}
NSData * encode64 (NSData * thedata)
@@ -28,8 +28,8 @@
int encodedLength = Base64encode_len([thedata length]);
char* encoded = (char*)malloc(sizeof(char) * encodedLength);
Base64encode(encoded,str,[thedata length]);
- NSData *result = [NSData dataWithBytesNoCopy:encoded length:encodedLength freeWhenDone:YES];
- return result;
+ NSString *result = [NSString stringWithUTF8String:encoded];
+ return [result dataUsingEncoding:NSUTF8StringEncoding];
}
#pragma mark Hex
View
BIN support/osx/encryptor
Binary file not shown.

0 comments on commit 1699be4

Please sign in to comment.
Something went wrong with that request. Please try again.