Advertisement
sophtwhere

NSData+Base64.h

Oct 28th, 2013
160
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  NSData+Base64.h
  3. //  base64
  4. //
  5. //  Created by Matt Gallagher on 2009/06/03.
  6. //  Copyright 2009 Matt Gallagher. All rights reserved.
  7. //
  8. //  This software is provided 'as-is', without any express or implied
  9. //  warranty. In no event will the authors be held liable for any damages
  10. //  arising from the use of this software. Permission is granted to anyone to
  11. //  use this software for any purpose, including commercial applications, and to
  12. //  alter it and redistribute it freely, subject to the following restrictions:
  13. //
  14. //  1. The origin of this software must not be misrepresented; you must not
  15. //     claim that you wrote the original software. If you use this software
  16. //     in a product, an acknowledgment in the product documentation would be
  17. //     appreciated but is not required.
  18. //  2. Altered source versions must be plainly marked as such, and must not be
  19. //     misrepresented as being the original software.
  20. //  3. This notice may not be removed or altered from any source
  21. //     distribution.
  22. //
  23.  
  24. #import <Foundation/Foundation.h>
  25.  
  26. void *NewBase64Decode(
  27.     const char *inputBuffer,
  28.     size_t length,
  29.     size_t *outputLength);
  30.  
  31. char *NewBase64Encode(
  32.     const void *inputBuffer,
  33.     size_t length,
  34.     bool separateLines,
  35.     size_t *outputLength);
  36.  
  37. @interface NSData (Base64)
  38.  
  39. + (NSData *)dataFromBase64String:(NSString *)aString;
  40. - (NSString *)base64EncodedString;
  41.  
  42. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement