ekscrypto / base64 Goto Github PK
View Code? Open in Web Editor NEWObjective-C Base64 Additions for NSData and NSString
License: MIT License
Objective-C Base64 Additions for NSData and NSString
License: MIT License
When decrypted, the NSData has often (not sure when exactly this happen) an extra character at the end, always a 7.
What am I doing wrong?
NSString *str = [[self convertToString:args] stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
NSData *decodedData = [self dataFromBase64String:paddedStr];
This is my code.
I think it's an easy fix of just adding an NSObject
superclass—sending a pull request momentarily.
It would be nice if you add SPM support.
Dear Creator
Would it be okay to use your work [Base64-1.1.2.zip] under Creative Commons CC0 v1.0 Universal License (CC0 v1.0)?
The Swiss law do not recognize a permanent relinquishment of Copyrights as the Public Domain provides for.
Thank you very much and kind regards
Philipp
The package is public domain, but you have "Copyright (c) 2012 Freshcode. All rights reserved." in the Base64/Base64/main.m file.
Well, If I am right, it would be necessary to add methods that convert string into base64UrlEncodedString
.
it could be useful in JWT library yourkarma/JWT#8.
Error info:
ld: library not found for -lBase64
dataWithBase64String produces NSData padded with 0's in some cases
Test string:
+eeehDVjt0qAN/eWmVYiCA==
Convert to NSData:
OpenSSL's Base64: <f9e79e84 3563b74a 8037f796 99562208> length: 16
NSData+Base64: <f9e79e84 3563b74a 8037f796 99562208> length: 16
...as expected, but:
Base64: <f9e79e84 3563b74a 8037f796 99562208 0000> length: 18
^^^^
I added repository as submodule and dragged project to workspace.
I noticed that something was wrong with this project - Base64 Xcode group has pointed to Base32 folder on disk.
I suppose that it was done for prevention of collisions.
However, could you change Base64 group path to Base64 ( now it points to Base32 ).
Or maybe it is better to rename Base64 to Base32 ( or another appropriate name ) to prevent any collisions.
Thanks!
UPD:
I can not use Xcode project now, because it has this workaround. It doesn't compile at all :(
Carthage build stops.
*** Skipped building Base64 due to the error:
Dependency "Base64" has no shared framework schemes
Version 1.1.2
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFString base64String]: unrecognized selector sent to instance 0x8295ef0'
Looks like iOS 6 isn't liking this very much.
The example app works great but when copying basically the same example into iOS it crashes. I'm installing an iOS5.1 simulator to test it, I'll let you know.
UPDATE: Same problem in iOS 5.
To avoid name collisions on category names please add method name prefixes
It seems that new version (1.1) is not available via cocoapods
Try to decode this for me please:
NSString *helloInBase64 = @"AwFjOHd6WJKLQ9YG6gRTw0t96a1vYHNxCGRJnLs0y7Pt6RnZp0pQqJ9v4/Ui0mjUPUFVJ4Aoz1BdCmTsEw8frgY8UbDPBURX40Xow147q6dxg++zNDC1VJ+QgC4zEr3jQs3W2BWuKzmZk3w77Dmc2j/2U8fAW/ubbWE9VgVEq7RigwqMdiZS5o6ilmyrfy+BFsbn5ivVAzQT/E7jJU8uLhaLFCzShuEF9ha0nlWfrjMs9jpFtSX5oZ1zhPEN3SaNVxF+y5OPkz9KEvb3RvvXUIgRvlqbG4vmmLEDCL/KEVis5uzn27hl4e6HUCbSzjKrMEVIhTUy0CC8eIc1Z1IHDf24/qgz2Orm2xgnu//h9M3uuUyqP6A5yiowkM4li3bNL19lGLxNuHdf80gk4VbjAVni7vTvd/brKVGEqh4Y3GvU1xGVJfumy0jnhq8dQfjHpUbRXvZUEXtLpx4E6qyfsfnlUAJJH/Ym4Mao8bPHJnq3Uy8uj2UzECViJ8qj1k3HU3mOMtNkmuNDlMA6WFiszzm6Qh70u6LMuYfD3f14sXgbFwbqduUurC3PAyiCGHYKsmNXr7SVQKxT4ndVjRSh4H94CXrXOQZpgcUVjl6LGtjjKVTAp72BOvkWFEwgm1o7LERPtZh77rsamEedTCjIPCQcWIXM5PxGYfIyH0pveiLv0Xd5QRTRSvgM5fbd0gYcPZCvstrOz8aVcxRta60a77x5NxoGEyshXlKSb9x9MILh0AwlYI8XnqGyEDLywGRk1bJAiWSdcGLk+dyOEBSejjW3aZrX8ee4fDM0/YZ3IWvgJw=="
If it works please tell me what didi you do?
And you sould get some funny encrypted charcters once when you decode.
can I use this to encode images? if yes how fast is this compared to default NSDATA base64 conversion?
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.