nicklockwood / base64 Goto Github PK
View Code? Open in Web Editor NEW[DEPRECATED]
License: Other
[DEPRECATED]
License: Other
hi nicklockwood~ I do not know why this warning shown ?
Please give me some help, thx
I have an encoded string getting from one of the node element of xml(soap response).
This is the encoded string:
UEsDBBQAAAAIAFyEdUFb+9U/vgAAAIABAAAIAAAAZGF0YS54bWyNkM0KwjAQhO+C7xD6AM1WPXhII4J400sFj2W1ixTSpCSx1bc3xoo/p+Y0M2S/ZEesbo1iHVlXG50nWQoJcx51hcpoypM7uWQlpxOxp36DHgvywTEmDnhSFGUwDhU5S215NhXJDGYAy/mCjT6C/xL+sRobkkejL6yoqWdb85QjYHFugHnCRs4hg4XgUQ85WsLXqzvBP+b9hbs+l6Yliz4UJNcB/psM95palx2q63N7gBRA8E8UC+PvxgT/6vIBUEsDBBQAAAAIAFyEdUFujsgBOAAAADYAAAAVAAAAVk1fQV9NU1RfU0FMRVNSRVAueG1ss7GvyM1RKEstKs7Mz7NVMtQzUFIoLknMS0nMyc9LtVWqTC1Wsrfj5bLxSy13SSxJDE4tUdC3AwBQSwECFAAUAAAACABchHVBW/vVP74AAACAAQAACAAAAAAAAAAAAAAAAAAAAAAAZGF0YS54bWxQSwECFAAUAAAACABchHVBbo7IATgAAAA2AAAAFQAAAAAAAAAAAAAAAADkAAAAVk1fQV9NU1RfU0FMRVNSRVAueG1sUEsFBgAAAAACAAIAeQAAAE8BAAAAAAA=
And I tried to use the following method to decode:
NSData *outputData = [NSData dataWithBase64EncodedString:@"UEsDBBQAAAAIAFyEdUFb+9U/vgAAAIABAAAIAAAAZGF0YS54bWyNkM0KwjAQhO+C7xD6AM1WPXhII4J400sFj2W1ixTSpCSx1bc3xoo/p+Y0M2S/ZEesbo1iHVlXG50nWQoJcx51hcpoypM7uWQlpxOxp36DHgvywTEmDnhSFGUwDhU5S215NhXJDGYAy/mCjT6C/xL+sRobkkejL6yoqWdb85QjYHFugHnCRs4hg4XgUQ85WsLXqzvBP+b9hbs+l6Yliz4UJNcB/psM95palx2q63N7gBRA8E8UC+PvxgT/6vIBUEsDBBQAAAAIAFyEdUFujsgBOAAAADYAAAAVAAAAVk1fQV9NU1RfU0FMRVNSRVAueG1ss7GvyM1RKEstKs7Mz7NVMtQzUFIoLknMS0nMyc9LtVWqTC1Wsrfj5bLxSy13SSxJDE4tUdC3AwBQSwECFAAUAAAACABchHVBW/vVP74AAACAAQAACAAAAAAAAAAAAAAAAAAAAAAAZGF0YS54bWxQSwECFAAUAAAACABchHVBbo7IATgAAAA2AAAAFQAAAAAAAAAAAAAAAADkAAAAVk1fQV9NU1RfU0FMRVNSRVAueG1sUEsFBgAAAAACAAIAeQAAAE8BAAAAAAA="];
NSString *outputString = [[NSString alloc] initWithData:outputData encoding:NSUTF8StringEncoding];
//NSAssert([outputString isEqualToString:inputString], @"OutputEqualsInput test failed");
NSLog(@"outputString: %@",outputString);
But I can't get the decoded string... Any help will be much appreciated. Thanks.
Hello.
I have added this to my project. I cannot compile my iOS application because it is throwing this error:
MyProject/NSStrinAdditions.h:44:9: Assigning to 'const unsigned char *' from incompatible type 'const void *'
How can I solve this?
Thank you.
At least according to analyser.
What helps , is if you add this bit of code towards the bottom:
...
}
//new code
if (outputLength == 0)
{
free(outputBytes);
outputBytes = nil;
return @"";
}
//truncate data to match actual output length
outputBytes = realloc(outputBytes, outputLength);
...
thanks!.
This function seems to pass line width as 0 but in base64EncodedStringWithWrapWidth it is still doing line wrapping.
I'm trying to use this library in a fairly simple way...
I have already imported the header into the top of this file
#import "Base64.h"
I am trying to use the NSString extension method like this...
NSString * encodedString = [string base64EncodedString];
And when the line of code runs, i get the following error...
-[__NSCFConstantString base64EncodedString]: unrecognized selector sent to instance 0x93e1c
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFConstantString base64EncodedString]: unrecognized selector sent to instance 0x93e1c'
*** First throw call stack:
(0x3354c3e7 0x3b3dc963 0x3354ff31 0x3354e64d 0x334a6208 0x5bd49 0x5b717 0x5ad6b 0x35446087 0x3544603b 0x35446015 0x354458cb 0x35445db9 0x3536e5f9 0x3535b8e1 0x3535b1ef 0x3704e5f7 0x3704e227 0x335213e7 0x3352138b 0x3352020f 0x3349323d 0x334930c9 0x3704d33b 0x353af2b9 0x59491 0x59418)
libc++abi.dylib: terminate called throwing an exception
Whats up?
Does the library properly account for padding?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.